-
Notifications
You must be signed in to change notification settings - Fork 537
Closed
Description
Here is an example
.
├── models
│ ├── pet.json
│ └── purebred_pet.json (#allOf has properties referring to pet.json)
└── parent.json
parent.json
{
"swagger": "2.0",
"info": {
"title": "flat",
"version": "1.0.0"
},
"definitions": {
"record": {
"$ref": "./models/purebred_pet.json"
}
}
}
models/pet.json
{
"type": "object",
"properties": {
"color": {
"type": "string"
}
}
}
models/purebred_pet.json
Notice here that pet.json is referenced using relative path which is in the same models folder.
{
"allOf": [
{
"$ref": "./pet.json"
},
{
"type": "object",
"properties": {
"breed": {
"type": "string",
"sample": "Labrador"
},
"mother": {
"$ref": "./pet.json"
},
"siblings": {
"type": "array",
"items": {
"$ref": "./pet.json"
}
}
}
}
]
}
Issue: parser fails with error Unable to load RELATIVE ref: ./pet.json. This happens because the pet.json under the properties is resolved RELATIVE to parent.json instead of purebred_pet.json.
I expect parser needs to resolve pet.json w.r.t. to the origin i.e. purebred_pet.json
I have already found a fix for this issue and PR is on its way.
Related to Issue #616 which only fixed the reference in the parent section of allOf. This issue is about references in the child or properties section of allOf construct.
Attn: @gracekarina
Metadata
Metadata
Assignees
Labels
No labels