Skip to content

Relative refs in parameters and schema are not resolved correctly #421

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

Closed
mkistler opened this issue Mar 13, 2017 · 0 comments
Closed

Relative refs in parameters and schema are not resolved correctly #421

mkistler opened this issue Mar 13, 2017 · 0 comments

Comments

@mkistler
Copy link
Contributor

If the value of a $ref is a relative reference but does not start with ".", the swagger core (specifically GenericRef) treats it as an internal ref. E.g.

"$ref" : "./path/to/model.json#/thing"

is treated as a relative URI but

"$ref": "path/to/model.json#/thing"

is treated as internal.

According to #306, this is intentional behavior in swagger core:

we added a convenience for a 1.2-style spec, where references did not need the full anchor.

So the parser needs to account for this by transforming actual relative refs into something that swagger-core will not try to treat as an internal ref.

The fix for #306 added code to make this transformation to relative refs that appear in properties. The same fix is needed for parameters and schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant