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

Supporting change in additionalProperties Boolean and Schema #612

Merged
merged 11 commits into from Jan 15, 2018

Conversation

gracekarina
Copy link
Contributor

@gracekarina gracekarina commented Dec 28, 2017

refs swagger-api/swagger-core#2461
#499 and fixing refs in additionalProperties Resolving RefExternalResolver #342 (in v3)

ArraySchema model = new ArraySchema();
model.setDescription(description);
model.setExample(example);
model.setItems(object.getAdditionalProperties());
if (object.getAdditionalProperties() != null && object.getAdditionalProperties() instanceof Schema) {
items = (Schema) object.getAdditionalProperties();
Copy link
Contributor

@ralphdoe ralphdoe Dec 28, 2017

Choose a reason for hiding this comment

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

It seems the variable item was created only for assignation, if there's no validation or another use it might be a good idea to delete it and set directly model.setItems((Schema)object.getAdditionalProperties());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!

Copy link
Contributor

@ralphdoe ralphdoe left a comment

Choose a reason for hiding this comment

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

It might be important to add a test, with a additionalProperties with. boolean values considering it's part of the issue requirement.

@gracekarina
Copy link
Contributor Author

This PR depends on swagger-api/swagger-core#2598

@frantuma frantuma merged commit 5b83c9c into 2.0 Jan 15, 2018
@gracekarina gracekarina deleted the ticket-2461_2.0 branch February 16, 2018 00:34
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.

None yet

3 participants