Skip to content

Fix JSON of Slack sample responses #17

@mre

Description

@mre

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions