openapi3
openapi3 copied to clipboard
$ref in path
I see this is a TODO. Any progress or updates you could share with me?
i'm not sure if there is active development on this library... @ElliottBregni have u found alternatives?
is this what u meant @ElliottBregni ?
cause it is exactly giving me trouble in parsing the public Atlassian's swagger

openapi3.errors.SpecError: Expected components.schemas.avatarUrls to be one of [['Schema', 'Reference']], but found {'description': 'The avatars of the user.', '$ref': '#/components/schemas/AvatarUrlsBean'}
I have a similar Issue.
while parsing this spec file, I received this error:
SpecError: Could not parse paths./nf-instances.get.parameters.6, expected to be one of [['Parameter', 'Reference']]
This is how the causing section looks like:
{
"name": "target-plmn-list",
"in": "query",
"description": "Id of the PLMN of the target NF",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "TS29571_CommonData.yaml#/components/schemas/PlmnId"
},
"minItems": 1
}
}
}
}
It should be valid OAS3, right?
@c7h - One issue i see with your spec is the use of reference items in another file. From what i can tell, openapi3 (this library) doesn't follow file $refs and can only handle everything in the same file (there don't appear to be any additional calls to yaml.load_safe other than in __main__.py
@c7h the above is true - at present this library does not load additional files when following $refs.
Additionally, the Parameter object has no content; it should instead have a schema that describes the parameter:
{
"name": "target-plmn-list",
"in": "query",
"description": "Id of the PLMN of the target NF",
"schema": {
"type": "array",
"items": {
"$ref": "TS29571_CommonData.yaml#/components/schemas/PlmnId"
},
"minItems": 1
}
}
Making this change results in the following (expected) error:
ReferenceResolutionError: Invalid reference path TS29571_CommonData.yaml#/components/schemas/PlmnId