-
Notifications
You must be signed in to change notification settings - Fork 2.2k
swagger-core treats relative refs without leading "." as internal refs #2138
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
Comments
Just found #1977 which is more or less a dup of this. Unfortunately, the fix (in swagger-api/swagger-parser#307) appears to only work for properties, and not paths, parameters, definitions, or responses. |
I'm not sure why this would be in this project. Are you parsing a specification that already exists? If so, please open this on the parser. Swagger core won't generate any $ref values like what you're describing. |
I wrote the bug against this project because It is the
And, yes, I am parsing an existing specification. So fixing this in the parser as was done for #1977 is sufficient for my purposes ... as long as it is implemented for all the element types. |
It actually started over in the parser project. For affected users it doesn't matter much where it's fixed - as long as it gets fixed at all. |
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.is treated as a relative URI but
is treated as internal.
I did research the syntax of $ref -- starting from the Swagger 2.0 spec, then to the JSON Schema spec, ending in IETF RFC 3986 Uniform Resource Identifier (URI): Generic Syntax -- and as best I can tell, a relative reference does not need to start with "." to be considered a relative reference.
The text was updated successfully, but these errors were encountered: