-
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] [BUG] Incorrect handling of non-wildcard google.api.http.body when using field_behaviour annotation #1937
Comments
This style of defining RPCs follows Google's AIP guidance (https://google.aip.dev/134) so it should be considered a valid way of defining methods. Open API 2.0 follows JSON Schema rules surrounding the The generated document is incorrect in that the required array is listing |
I see, well, it sounds straightforward enough not to add a |
Sure I'll take a crack at it. |
I have a really simple fix for this in particular. One question I had though was for the files under
|
Thanks for asking! I left a comment on the PR re: the new files.
I'm not entirely sure what you mean by this, we have a section in the docs about using
This would be great 😄. We don't have an automated process for this, and I don't think they've changed anything that will affect us, by "why not" is good enough for me. |
🐛 Bug Report
With the introduction of #1806 rpc definitions definitions that have a non-wildcard body property now fail validation. The generated code breaks because it produces a swagger document whose body parameter is a reference to the request definition but also has a
required
entry in the object.Note that this file swagger file failed
npx @opernapitools/openapi-generator-cli generate
with error saying thatrequired
is unexpected.To Reproduce
Proto File (./genproto/test/v1alpha/test.proto)
Run
protoc -I. --openapiv2_out . --openapiv2_opt logtostderr=true ./genproto/test/v1alpha/test.proto
Expected behavior
Actual Behavior
Note the schema change under the request parameters
Your Environment
(Environment name, version and operating system.)
uname -a:
Linux 1319df9505dc 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 GNU/Linux
go version: 1.13.5
The text was updated successfully, but these errors were encountered: