The sample responses from the official Slack documentation are often invalid JSON.
For example, check files.upload (because of '...') or im.history (because of a trailing comma in the second message).
Given that slackhq/slack-api-docs is currently not receiving any updates, we should fix that on our side.
I was looking into possible solutions. Unfortunately I did not find any pure-Ruby solution yet. Do you know of any? JSON is tricky to fix automatically. The two most promising solutions I found are:
Both projects promise automatic fixing of JSON.
Since eslint/eslint is well-maintained and offers lots of fixes, I would go with that.
Heads up:
- Javascript Runtime required.
- eslint fixes files in-place. We would need to call it from the commandline.
Here is an example of how I would integrate it. I'm not really happy about the code but I couldn't come up with anything better either.
If you like the idea then I would go ahead and integrate it.
Otherwise I'm open for suggestions.
The sample responses from the official Slack documentation are often invalid JSON.
For example, check files.upload (because of '...') or im.history (because of a trailing comma in the second message).
Given that slackhq/slack-api-docs is currently not receiving any updates, we should fix that on our side.
I was looking into possible solutions. Unfortunately I did not find any pure-Ruby solution yet. Do you know of any? JSON is tricky to fix automatically. The two most promising solutions I found are:
Both projects promise automatic fixing of JSON.
Since eslint/eslint is well-maintained and offers lots of fixes, I would go with that.
Heads up:
Here is an example of how I would integrate it. I'm not really happy about the code but I couldn't come up with anything better either.
If you like the idea then I would go ahead and integrate it.
Otherwise I'm open for suggestions.