examples/defs_and_refs/defs_and_refs.json.schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [ "key", "value" ],
"properties": {
"key": { "type": "string" },
"value": {
"type": "object",
"required": [ "name" ],
"properties": {
"name": { "type": "string" },
"obj": {
"type": "object",
"properties": {
"tag": { "type": "string" },
"data": { "$ref": "#/definitions/obj" }
}
},
"arr": {
"type": "array",
"items": [
{ "$ref": "#/definitions/obj" },
{ "$ref": "#/definitions/other_object" }
]
}
}
}
},
"definitions": {
"obj": {
"type": "object",
"required": ["size", "content"],
"properties": {
"size": {
"type": ["integer", "number"]
},
"content": {
"type": ["string", "null"]
}
}
},
"other_object": {
"type": "object",
"required": ["data"],
"properties": {
"data": { "type": "string" }
}
}
}
}