Would it be useful to make a json-schema for something using json-api?


I was looking at this one project that I like and it has a json-api drafted. I thought “I should make a json-schema for this”. I’ve never made one. It’s turning out to be hard. And I’m not finding any prior art on the internet, so maybe I’m like trying to put a round peg in a square hole.

For example, all the interesting bits in a json-api are nestled inside the attributes object inside the data object, and I’m not sure how you go about nesting definitions in a json-schema or if you’re allowed to.

You could write a generic schema, which you guys already have at http://jsonapi.org/schema
But then do you get all that magical stuff like automatically generating clients and documentation that json-schema promises?

Just remembered why I thought I wanted the schema in the first place: validating-json-schemas-with-an-rspec-matcher