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

deserialize as arrayModel, any model that has items and no specific type defined #4109

Merged
merged 2 commits into from
Feb 2, 2022

Conversation

gracekarina
Copy link
Contributor

This PR adds support for items all Schema types.
refs: swagger-api/swagger-parser/1636

Copy link
Member

@frantuma frantuma left a comment

Choose a reason for hiding this comment

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

Possibly there is a better way to handle this as adding items to ModelImpl leaving also the field in ArrayModel will possibly break things and be source of confusion.

As this is meant to fix swagger-api/swagger-parser#1636, the best course of action would be probably to update deserializer to also deserialize to ArrayModel when type is empty AND items field is present. On the parser side, a similar change can be implemented in SwaggerDeserializer.

In both cases we would deserialize into ArrayModel and after instantiation we would set type to null as it is in source

@gracekarina gracekarina merged commit 156c31c into 1.5 Feb 2, 2022
@gracekarina gracekarina changed the title add item support in ModelImpl deserialize as arrayModel, any model that has items and no specific type defined Feb 2, 2022
@gracekarina gracekarina deleted the items1636Support branch February 23, 2022 17:02
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