Skip to content

Instantly share code, notes, and snippets.

@jsmestad
Created October 3, 2014 20:58
Show Gist options
  • Save jsmestad/99f736797759fb1b0724 to your computer and use it in GitHub Desktop.
Save jsmestad/99f736797759fb1b0724 to your computer and use it in GitHub Desktop.
{
"id": "http://jsonapi.org/schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Schema",
"description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org",
"type": "object",
"resources":{
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type":["string"] },
"href": { "type":"string" },
"links": { "type": "object" }
},
"required": ["id"]
}
},
"patternProperties": {
"^(?!href$)(?!links$)(?!id$)(?!meta)(?!linked)": {
"$ref":"#/resources"
}
},
"properties": {
"meta": {
"type": "object"
},
"links":{
"type": "object"
},
"linked": {
"type": "object",
"patternProperties": {
".*": {
"$ref":"#/resources"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment