slack-rs / slack-api-schemas

Schemas for the Slack API
1 stars 11 forks source link

Trying to use this to update slack-rs-api, seems broken? #7

Open saethlin opened 6 years ago

saethlin commented 6 years ago

I'd like to update the definitions for slack-rs-api, but it looks like it's broken? I'm not a JS dev so I'm quite lost here, can anyone point me in the right direction?

Replacing ... in object fields in response for file_mention
Replacing ... in object fields in response for file_share
Replacing ... in object fields in response for pinned_item
undefined:1

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at /home/ben/slack-api-schemas/api_scraper/index.js:877:56
    at Array.forEach (native)
    at /home/ben/slack-api-schemas/api_scraper/index.js:876:20
    at /home/ben/slack-api-schemas/api_scraper/node_modules/async/lib/async.js:52:16
    at /home/ben/slack-api-schemas/api_scraper/node_modules/async/lib/async.js:361:13
    at /home/ben/slack-api-schemas/api_scraper/node_modules/async/lib/async.js:52:16
    at replenish (/home/ben/slack-api-schemas/api_scraper/node_modules/async/lib/async.js:306:28)
    at /home/ben/slack-api-schemas/api_scraper/node_modules/async/lib/async.js:326:29
    at /home/ben/slack-api-schemas/api_scraper/node_modules/async/lib/async.js:44:16

It looks like the culprit is this line

const messageSchema = GenerateSchema.json(JSON.parse(sanitizeResponse(messageType.name, messageType.sample)));
Mange commented 6 years ago

I'll see if I can find a fix for it.