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

**URL:** <https://discuss.jsonapi.org/t/would-it-be-useful-to-make-a-json-schema-for-something-using-json-api/317>\
**Category:** Uncategorized\
**Created:** [January 26, 2016, 6:02am UTC](https://discuss.jsonapi.org/t/would-it-be-useful-to-make-a-json-schema-for-something-using-json-api/317 "2016-01-26T06:02:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![laduek](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@laduek](https://discuss.jsonapi.org/u/laduek)\
**Post date:** [January 26, 2016, 6:02am UTC](https://discuss.jsonapi.org/t/would-it-be-useful-to-make-a-json-schema-for-something-using-json-api/317/1 "2016-01-26T06:02:51Z")

</div>

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](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](https://robots.thoughtbot.com/validating-json-schemas-with-an-rspec-matcher)
