Closed dsuch closed 1 year ago
Your specific issue appears to be in general.py::Reference.can_parse(), specifically these lines:
# TODO - can a reference object have spec extensions?
cleaned_keys = [k for k in dct.keys() if not k.startswith("x-")]
return len(cleaned_keys) == 1 and "$ref" in dct
In your sample YAML you have description fields (albeit empty strings), but these cause the len check to evaluate to false (as there are two keys - $ref and description).
If you can remove all but the $ref fields, your spec now parses.
It's not clear from the spec docs I can find whether it is legal to have a $ref field and additional fields
I found the same in the Spotify OpenAPI specs
It looks like, as of OpenAPI 3.1.0, the Reference Object was updated to include optional summary
and description
fields: 3.1.0 Reference Object vs 3.0.0 Reference Object definition. I must've missed that - I'll add this behavior in.
Hello,
this is just a quick report that openapi3 1.5.0 fails to parse a definition that is correct. The YAML file is attached and the exception is below.
I believe this is happening because instead of an inline schema, I use a reference in the form of
$ref: '#/components/schemas/zato.server.service.internal.helpers.MyUser
but I have not investigated it closer.The YAML definition is correct and it validates with several other tools.
Thank you.
zato-test.txt