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

Fix array schema deserialization #585

Merged
merged 2 commits into from
Nov 21, 2017
Merged

Conversation

gracekarina
Copy link
Contributor

@gracekarina gracekarina commented Nov 19, 2017

Fixes #584 came up while developing swagger-api/swagger-inflector#215

@gracekarina gracekarina requested a review from frantuma November 19, 2017 02:55
items.setItems(getSchema(itemsNode, location, result));
if (itemsNode.getNodeType().equals(JsonNodeType.OBJECT)){
items.setItems(getSchema(itemsNode, location, result));
}else if (itemsNode.getNodeType().equals(JsonNodeType.ARRAY)){
Copy link
Member

Choose a reason for hiding this comment

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

which case is this handling? should it be perhaps a recursive call instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi I don't understand the question, getSchema() is a recursive call

arrayModel.setItems(arrayModel.getItems());
if(arrayModel.getItems().get$ref() != null) {
arrayModel.setItems(resolveSchema(arrayModel.getItems()));
}
Copy link
Member

Choose a reason for hiding this comment

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

maybe use if/else..

if(arrayModel.getItems().get$ref() != null) {
  arrayModel.setItems(resolveSchema(arrayModel.getItems()));
} else {
  arrayModel.setItems(arrayModel.getItems());
}

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.

2 participants