Skip to content

Instantly share code, notes, and snippets.

@edgarmueller
Last active December 18, 2015 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edgarmueller/f78cd12871f01d869284 to your computer and use it in GitHub Desktop.
Save edgarmueller/f78cd12871f01d869284 to your computer and use it in GitHub Desktop.
Example Library JSON Schema
{
"definitions": {
"writer": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"books": {
"type": "array",
"items": {
"$ref": "#/definitions/book"
}
}
}
},
"book": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"pages": {
"type": "number"
},
"category": {
"type": "string",
"enum": [
"Mystery",
"ScienceFiction",
"Biography"
]
},
"author": {
"$ref": "#/definitions/writer"
}
},
required: ["author"]
}
},
"properties": {
"name": {
"type": "string"
},
"writers": {
"type": "array",
"items": {
"$ref": "#/definitions/writer"
}
},
"books": {
"type": "array",
"items": {
"$ref": "#/definitions/book"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment