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 value of enum to be Array #850

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
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