Skip to content

Fix value of enum to be Array #850

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 6, 2022

Conversation

takahashim
Copy link
Contributor

I am trying to use grape-swagger and other OpenAPI tools, but currently there seems to be a problem with the schema generated by grape-swagger.

In the OpenAPI 2.0 specification, enum uses the JSON Schema enum.

In JSON Schema, the value of an enum is expected to be an Array.

However, in grape-swagger, an enum value can be a String literal.

This pull request fixes that and returns an Array.

I hope this change can be accepted.

@LeFnord
Copy link
Member

LeFnord commented Mar 6, 2022

thanks @takahashim … looks reasonable for me, please add an entry to the UPGRADE

@takahashim
Copy link
Contributor Author

Thanks a lot! Also added a line to UPGRADING.md.

@LeFnord LeFnord merged commit eb94a31 into ruby-grape:master Mar 6, 2022
@takahashim takahashim deleted the fix-enum-values branch March 6, 2022 16:44
aka-momo pushed a commit to aka-momo/grape-swagger that referenced this pull request Feb 8, 2023
Bhacaz pushed a commit to Bhacaz/grape-swagger that referenced this pull request Aug 31, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants