Skip to content
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

Fixing composedSchema deserializing and resolving, allof, anyOf, Oneof #516

Merged
merged 3 commits into from
Sep 11, 2017

Conversation

gracekarina
Copy link
Contributor

The deserializing of composedSchema was only returning the last object of the arrays, and there were some issues in the resolving of this schemas.

for(JsonNode n : allOfArray) {
if(n.isObject()) {
ComposedSchema allOfList = new ComposedSchema();
schema = getSchema((ObjectNode) n,location,result);
allOfList.addAllOfItem(schema);
schema = allOfList;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema = allOfList; : this line should be outside the for structure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right

for(JsonNode n : anyOfArray) {
if(n.isObject()) {
ComposedSchema anyOfList = new ComposedSchema();
schema = getSchema((ObjectNode) n,location,result);
anyOfList.addAnyOfItem(schema);
schema = anyOfList;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema = anyOfList; : this line should be outside the for structure

@phiz71
Copy link
Contributor

phiz71 commented Sep 8, 2017

I think the fixing of the oneOf case has been forgotten 😉

@gracekarina
Copy link
Contributor Author

hehe done!

@webron webron merged commit 500f319 into 2.0 Sep 11, 2017
@webron webron deleted the fix-example-in-schema branch September 11, 2017 13:03
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

Successfully merging this pull request may close these issues.

3 participants