Example of biredirectional relationship
https://spacetelescope.github.io/understanding-json-schema/structuring.html Relations can be expressed using $ref and definitions. Can you put an example of how to handle bidirectional relationships such as below
class Person {
Nose nose
}
Class Nose {
Person person
}
When generating schema for person, we can have $ref and defintion for person.. but how should the person reference in nose should be handled.
Also, How many levels deep, Human > Head > Brain > Nerves etc
Sorry for the delayed response. I'm taking this project out of the deep freeze :)
This seems like an infinitely looping relationship. Can you provide a JSON snippet of what you are trying to validate? It seems like at a minimum you'd need to make either Person.Nose or Nose.Person optional so the data structure would have an opportunity to "stop" recursing.
Also, to note, the spec says you MUST NOT run $ref in a recursive loop in your schemas. https://tools.ietf.org/html/draft-handrews-json-schema-01#section-8.3