We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How the string type supports enum option:
string sort_direction = 1 [ (validate.rules).string = { in: [ 'asc', 'desc' ] }, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { enum: [ 'asc', 'desc' ] } ];
protoc-gen-openapiv2 actual output:
{ "name": "sort_direction", "in": "query", "required": false, "type": "string" }
expect output:
{ "name": "sort_direction", "in": "query", "required": false, "type": "string", "enum": [ "asc", "desc" ] }
The text was updated successfully, but these errors were encountered:
This sounds like a bug, I would expect that to populate the enum field as you expect. I expect it would do the right thing if the field type was an enum, but we should be able to support this annotation too. Would you be willing in helping to fix this? You probably want to start looking here: https://github.com/grpc-ecosystem/grpc-gateway/blob/main/protoc-gen-openapiv2/internal/genopenapi/template.go#L321
Sorry, something went wrong.
Would you be willing in helping to fix this
Code is committed and unit tests are added.
Please review.
Successfully merging a pull request may close this issue.
🚀 Feature
How the string type supports enum option:
protoc-gen-openapiv2 actual output:
expect output:
The text was updated successfully, but these errors were encountered: