-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
It would seem that definitions are processed depth-first, rather then breadth-first. As the code is today, dependencies must be defined before their dependents.
This schema works...
{
"type":"object",
"title":"Itinerary",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"Leg": {
"type":"object",
"properties": {
"Carrier": {
"type":"string"
}
}
},
"Segment": {
"type":"object",
"properties":{
"Legs": {
"type":"array",
"items":{
"$ref":"#/definitions/Leg"
}
}
}
},
"Trip": {
"type":"object",
"properties": {
"Segments": {
"type":"array",
"items":{
"$ref":"#/definitions/Segment"
}
}
}
}
},
"properties": {
"Trips": {
"type":"array",
"items": {
"$ref":"#/definitions/Trip"
}
}
}
}
...while this one doesn't. It fails with:
Uncaught Must set ajax option to true to load external url #/definitions/Segment
{
"type":"object",
"title":"Itinerary",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"Trip": {
"type":"object",
"properties": {
"Segments": {
"type":"array",
"items":{
"$ref":"#/definitions/Segment"
}
}
}
},
"Segment": {
"type":"object",
"properties":{
"Legs": {
"type":"array",
"items":{
"$ref":"#/definitions/Leg"
}
}
}
},
"Leg": {
"type":"object",
"properties": {
"Carrier": {
"type":"string"
}
}
}
},
"properties": {
"Trips": {
"type":"array",
"items": {
"$ref":"#/definitions/Trip"
}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels