-
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
OpenAPIv2 YAML format does not include extensions #2795
Comments
cc: @hedhyw |
Thanks for this detailed issue. If someone is interested in trying to fix this, I would suggest starting by adding a failing test. Look at the tests added in #2579 for inspiration. As a workaround for this issue, there appear to be lots of different tools available for converting JSON to YAML as a post-processing step: https://www.google.com/search?client=firefox-b-d&q=json2yaml. |
@johanbrandhorst Yes that is what we started doing as soon as we found the bug. |
@hedhyw I am not sure how I could verify this change. I am using
|
@hasit it won't be available on the BSR until we've made a release. If you want to test the change locally, you'll have to build a binary locally. Since the PR is on a fork, it's a little complicated to test before we've merged it. You could check out the PR locally and run - name: openapiv2
path: ./<path to built protoc-gen-openapiv2>
out: gen/openapiv2
opt:
- json_names_for_fields=false
- merge_file_name=file
- allow_merge=true
- output_format=json
- generate_unbound_methods=true But we should get this merged soon, I'm looking at the PR, and then you can install directly using |
We'll get this released soon, it's about time for another release, but if you want to test this in the meantime, you should now able to install
|
@johanbrandhorst wonderful! Thanks to you and @hedhyw :) |
This has been released in https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v2.11.0 |
🐛 Bug Report
I have a field
bar
in a messageFoo
for which I would like to generate swagger documentation.Upon generation, I see the description field being generated correctly, but not the x-go-default field.
To Reproduce
I use the following
buf.gen.yaml
openapiv2 plugin options:After changing
output_format=yaml
tooutput_format=json
, thex-*
fields started showing up.Expected behavior
Expect output to contain
x-go-default
field populated with "0.5s" value.Actual Behavior
Actual output contains all fields apart from the extensions provided.
Your Environment
Remote plugin via buf: buf.build/grpc-ecosystem/plugins/openapiv2:v2.10.3-1
Operating system: Pop!_OS 22.04 LTS x86_64
The text was updated successfully, but these errors were encountered: