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 OpenAPI constraints for array schemas #709

Merged
merged 3 commits into from
Aug 13, 2020
Merged

Fix OpenAPI constraints for array schemas #709

merged 3 commits into from
Aug 13, 2020

Conversation

pewniak747
Copy link
Contributor

Issue: #657

Turns out the bug is more general, and not limited to arrays of enums.

In the case of array schemas, the constraints of the array elements were being attached to the array itself when generating the OpenAPI descriptions.

This is fixed by not extracting validators out of CollectionElements validator when the schema is equal to SArray, and extracting all validators otherwise. Added an additional test that validates an array of ints to prove the solution.

nickelioio and others added 3 commits August 11, 2020 16:17
This prevents the enum: validator being attached on the array level
in OpenAPI yaml.
In the case of array schemas, the constraints of the array elements were
being attached to the array itself when generating the OpenAPI descriptions.

This is fixed by not extracting validators out of CollectionElements
validator when the schema is equal to SArray, and extracting all
validators otherwise.
@adamw adamw merged commit e07c41e into master Aug 13, 2020
@mergify mergify bot deleted the bugfix/657 branch August 13, 2020 07:52
@adamw
Copy link
Member

adamw commented Aug 13, 2020

Released in 0.16.13, thanks!

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.

[BUG] Duplicated enum property in openapi when wrapping enumeratum enum with array
3 participants