-
Notifications
You must be signed in to change notification settings - Fork 241
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
Handle google/protobuf/wrappers.proto types on protoc-gen-openapi #366
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
fdf6469
to
3a2e416
Compare
3a2e416
to
02faba9
Compare
Bump on this. Can a maintainer please review? |
up |
I signed it! |
Hi @galihputera Sorry for the slow response. Have you tested this against Envoy or something like that? |
Hey, This has nothing to do with envoy. You can also see it in the official documentation of wrappers.proto:
|
👍 this looks great - I came here looking for the Haven't tested the wrapper types with envoy - but I can confirm that for gnostic/third_party/google/protobuf/timestamp.proto Lines 108 to 147 in 3751138
Same is valid for |
Thanks, @timburks for your approval! but I still couldn't merge it. Could you help me do that? |
@galihputera done, thank you! |
According to https://developers.google.com/protocol-buffers/docs/proto3#json, Wrapper Types use the same representation in JSON as the wrapped primitive type. On this MR I Modify protoc-gen-openapi code to be able to parse Wrapper Types on schema and parameters.
Also in this MR is changes to map
google.protobuf.Timestamp
field into string when used as URL query parameters. Previously it will be mapped into two separate fields, for exampletimestamp_type
will mapped intotimestampType.seconds
andtimestampType.nanos
Manual Testing
Unit Test
Steps
Result
Check generated openapi using Swagger UI
Command
Result on Query String
Result on Schema