-
Notifications
You must be signed in to change notification settings - Fork 533
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
$ref not fully resolved for object with no type #1433
Comments
hey @phiz71, please create the PR and we will test the impact in other OSS projects dependant of parser, and see if anything breaks 😉 |
phiz71
added a commit
to phiz71/swagger-parser
that referenced
this issue
Sep 30, 2020
phiz71
added a commit
to phiz71/swagger-parser
that referenced
this issue
Oct 1, 2020
phiz71
added a commit
to phiz71/swagger-parser
that referenced
this issue
Oct 1, 2020
kerrykimbrough
pushed a commit
to kerrykimbrough/swagger-parser
that referenced
this issue
Nov 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I want to parse an openAPI document with $ref but even with the
resolveFully
option, it does not work.Problem
I want to parse this document
I use the
resolveFully
option and I expect to have this result:But instead, the
FooInput.input
ref is not resolved.Analysis
After some test, i found out that if I add
type: object
to eitherFooInput
schema orBazInput
schema, the resolution is correct.If i add
type: object
inFooInput
, the resolver execute this code (io.swagger.v3.parser.util.ResolverFully
):https://github.com/swagger-api/swagger-parser/blob/master/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ResolverFully.java#L323
If i add
type: object
inBazInput
, the resolver execute this code (io.swagger.v3.parser.util.ResolverFully
):https://github.com/swagger-api/swagger-parser/blob/master/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ResolverFully.java#L398
Proposition
I think there is a problem in the second part of code.
Because if property is an instance of ObjectSchema, it means property.getType() is not null.
So I propose to remove the
if
and to keep only:If you are ok with this, I can create a PR.
The text was updated successfully, but these errors were encountered: