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

OpenAPIDeserializer.getSchema: Handle "enum" correctly when schema type is "array" or "object" #1490

Merged
merged 22 commits into from Nov 14, 2020

Conversation

kerrykimbrough
Copy link
Contributor

Fixes issue #1419

For a schema of type array, each element of the enum array must be an array. But an enumerated array may contain values that don't have a native Java representation (for example, "object" values). Therefore, an enumerated array element is represented by an ArrayNode value, which contains the fully-parsed representation of the enumerated value.

Similarly, for a schema of type object, each element of the enum array must be an object. But an object value doesn't have a well-defined native Java representation. Therefore, an enumerated object element is represented by an ObjectNode.

But in any case, a null element of an enum array is represented by a Java null value, which is consistent with enum handling for all other schema types.

@gracekarina gracekarina merged commit 04dbe04 into swagger-api:master Nov 14, 2020
@gracekarina
Copy link
Contributor

thanks @kerrykimbrough

@kerrykimbrough kerrykimbrough deleted the issue-1419 branch November 24, 2020 23:41
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

5 participants