-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: YAML output of examples is wrong #3095
Comments
Hi, thanks for your issue! Looks like this is a special case for the |
|
Hm, that looks like YAML, I wonder if this is a problem with the yaml marshaler. Can you try to generate a JSON version? |
@johanbrandhorst you're right, i just change output to JSON, and look's good 👍 .
|
Great, that definitely narrows down the problem to the YAML output. The logic for this lives here: grpc-gateway/protoc-gen-openapiv2/internal/genopenapi/format.go Lines 33 to 37 in 257af99
We may need to add some sort of workaround for json.RawMessage in the yaml marshaler. Thoughts @hedhyw? |
@nipeharefa I've just fixed this in #3106, please try to use it from my branch and test it. |
🐛 Bug Report
Hello, this is my first issue, I just try using protoc-gen-openapiv2 and write some proto but I found when write the example of response and render it, the output will render
[]byte
.To Reproduce
(Write your steps here:)
[]byte
:My example proto
i;m using buf to generate, this is my configuration:
The text was updated successfully, but these errors were encountered: