stoplightio/spectral

ruleset: JSON:API

ahx opened this issue · 7 comments

ahx commented

User story.
As a developer, I can use Spectral to guide me while designing my JSON:API API.
Spectral returns errors and warnings if responses do not look like JSON:API responses.

Describe the solution you'd like
I can use a new ruleset jsonapi-openapi which extends the spectral:oas ruleset. Using this ruleset helps me describe APIs that conform with JSON:API.
Beginning with rules to describe response bodies only would be a great start.

Additional context
Could we make use of http://jsonapi.org/schema ?

I hope this makes sense.

@dgeb did you ever make any progress on this one?

Also should it be a "JSON Schema in OpenAPI" ruleset? Because im not sure how a "plain JSON:API" ruleset would work, as we need a JSON/YAML file to look at.

ahx commented

@philsturgeon

Also should it be a "JSON Schema in OpenAPI" ruleset? Because im not sure how a "plain JSON:API" ruleset would work, as we need a JSON/YAML file to look at.

It should work just like the other rulesets, but tailored to be helpful when designing JSON:API conform APIs. I don’t think I understand your question.

ahx commented

@philsturgeon designing with OpenAPI. Using OpenAPI YAML files as a medium.
I am thinking about an OpenAPI first approach. – Writing the OpenAPI file first (YAML).

@ahx any progress on this? I'd be happy to help!

ahx commented

@michaelmerrill I did not do any work in this. Sorry. 😬
Note that there is also https://github.com/openapi-contrib/style-guides.