-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to decode a $ref
to a response component inside another response component
#377
Comments
You are quite right. The current implementation in OpenAPIKit does not support reference objects for values within the components object like it should. Superficially, this won’t be too hard to fix (though it will impact other parts of the codebase that need to know how to navigate the components object). Unfortunately, it is also a breaking change even though it fixes a bug with our adherence to the OpenAPI specification. This should get fixed by pull request to the |
Since there is an indeterminate horizon on the fix landing downstream where you can use it to generate code, I’d be happy to brainstorm workarounds for you if that is helpful. |
Ah ok, that makes sense. I'm happy to not worry about it right now, especially as it seems to let me reference schemas from inside other schema definitions in the components object. It seemed to be a specific problem for responses, so I'll just comment it out for now and follow updates on the generator repo. |
I've started this work on this branch. Lot's of changes remaining including test coverage but I had to get started at some point. |
In preparation for a v4.0.0 release, I am bumping this issue to the v5.x milestone. |
While using the Swift OpenAPI generator, I was having problems generating code from my spec file. Error message:
Found at least one vendor extension property that does not begin with the required 'x-' prefix. Invalid properties: [ $ref ]
.I finally was able to find where the problem was by setting a breakpoint inside
Yams
'sYAMLDecoder
'sdecode
function, and inspecting theunderlyingError
for theCodingPath
. This led to theMissingToken401
's$ref
field. Originally, I thought the problem was that it didn't like having an overridingdescription
field, but with that removed, it said it was missing adescription
field.The OpenAPI spec says it supports
$ref
s in any of the components (minus theschemas
component section), so this should be supported.If I'm missing something, let me know.
Here's the section:
The text was updated successfully, but these errors were encountered: