-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
protoc-gen-openapiv2 v2.2.0 only generates 'required' for scalar fields when using field_behavior REQUIRED #1963
Comments
Sure, below is an example. After further investigation, it looks like scalar fields are included correctly in the
Relevant portion of the OpenAPI output under v2.2.0:
What it looks like under v2.1.0:
I believe the correct behavior here would be to remove the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
🐛 Bug Report
I just updated from v2.1.0 to v2.2.0 and regenerated (no other changes), and it appears that when multiple fields in a message have
(google.api.field_behavior) = REQUIRED
set, only the first field is being included in the OpenAPI definitions section as required. Diffing against my previous results, I see a bunch of updates to messages like the following:To Reproduce
(Write your steps here:)
(google.api.field_behavior) = REQUIRED
set.--openapiv2_out=../openapi 0-openapiv2_opt=allow_merge=true,merge_file_name=merged
Expected behavior
All fields marked REQUIRED should be in the required array.
Actual Behavior
Only the first field is included (I think?)
Your Environment
Docker, latest stable Alpine, Go 1.15, latest stable packages, v2.2.0 grpc-gateway.
The text was updated successfully, but these errors were encountered: