Created
July 16, 2015 03:31
-
-
Save JamesMessinger/d18278935fc73e3a0ee1 to your computer and use it in GitHub Desktop.
JSON Schema Circular $Refs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"definitions": { | |
"thing": { | |
"$ref": "#/definitions/thing" // circular reference to self | |
}, | |
"person": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"spouse": { | |
"type": { | |
"$ref": "#/definitions/person" // circular reference to parent | |
} | |
} | |
} | |
}, | |
"parent": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"children": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/child" // indirect circular reference | |
} | |
} | |
} | |
}, | |
"child": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"parents": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/parent" // indirect circular refernece | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment