-
Notifications
You must be signed in to change notification settings - Fork 523
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
Fix various ref handling (fixes : #2086) #2087
base: master
Are you sure you want to change the base?
Fix various ref handling (fixes : #2086) #2087
Conversation
d04e41c
to
18400a0
Compare
@gracekarina I see that you have worked on the files in which most of this changes are done for this issue (#2086). Would be great if you can take a look at these changes. |
Have a blanket IT type test for now, can add more in depth UTs once I get some comments on these changes. |
Thanks @frantuma for assigning this to yourself! |
P.S: These issues are not present in the npm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anthochristen thanks a lot for your PR
added a couple of comments
} else { | ||
processSchema(s, file); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to add processProperties(arraySchema.getItems().getProperties(), file);
also here as a composed schema can also have properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this scenarios was handled in the latest snapshot version of reverted this change for arrays.
@@ -246,9 +264,29 @@ private void processSchema(Schema property, String file) { | |||
} | |||
if (property instanceof ComposedSchema) { | |||
ComposedSchema composed = (ComposedSchema) property; | |||
final Map<String, String> refMap = Optional.ofNullable(property.getDiscriminator()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIANM the changes here, alongside the ones in SchemaProcessor
and PathsProcessor
, consider oneOf
and anyOf
as mutually exclusive, while they can coexist even if not so common. I would suggest to consider them both in the processing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per suggestion, thanks!
}if (composedSchema.getAnyOf() != null) { | ||
for(Schema innerModel : composedSchema.getAnyOf()) { | ||
} | ||
if (composedSchema.getAnyOf() != null || composedSchema.getOneOf() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AS mentioned above:
IIANM the changes here consider oneOf
and anyOf
as mutually exclusive, while they can coexist even if not so common. I would suggest to consider them both in the processing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the processing to be mutually inclusive.
Intuitively though, the definitions feel that they are mutually exclusive.
@@ -157,8 +157,10 @@ public void processComposedSchema(ComposedSchema composedSchema) { | |||
} | |||
} | |||
} | |||
}if(composedSchema.getOneOf() != null){ | |||
final List<Schema> schemas = composedSchema.getOneOf(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AS mentioned above:
IIANM the changes here consider oneOf
and anyOf
as mutually exclusive, while they can coexist even if not so common. I would suggest to consider them both in the processing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as suggested.
076540b
to
0f34603
Compare
0f34603
to
a19e9e0
Compare
@frantuma I've changed the oneOf and anyOf to be inclusive, kindly help take a look when possible, thanks! |
a19e9e0
to
04d7ef2
Compare
This PR is to address the $ref handling issues in callbacks and discriminator mapping objects as detailed in #2086.
It does it with the following changes
anyOf
like its done forOneOf
inSchemaProcessor
class.ComplexSchemas
processRefToExternalPathItem
inExternalRefProcessor
so that it can be used for $ref path resolution in PathItems used within callbacks.Each done in dedicated commits, although there might be some spill over.