Skip to content

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
Contributor

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
Contributor

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.

3 participants