-
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
Example and pattern annotations are not respect for query and path parameters #4130
Comments
Hm, that's odd, in our example protobuf file you can see that the example and pattern both make it into the generated file: grpc-gateway/examples/internal/proto/examplepb/a_bit_of_everything.proto Lines 193 to 202 in c2720cd
grpc-gateway/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json Lines 7795 to 7809 in c2720cd
Could you provide a test repo that reproduces the issue? Or better yet, make a contribution to our repo that exhibits the issue. |
Please find attached a zip of a sample repo. that reproduces the issue. |
Thank you, with all due respect, I'm not going to download a zip file from a stranger on the internet. Could you please provide a github repository or gist or something where I can view the contents? Thanks. |
I've created a private repo here, and have sent you an invite. |
Sorry, that invitation expired, my bad, could you send it again please? |
OK I can reproduce the issue. Seems like we only render the example when the field in question is used in the request body, not when it's part of the path or the query. I think we should be able to support including the example and other fields for non-body fields too. |
Would you be interested in contributing a fix for this? |
I'd like to but honestly I don't have the spare time outside of work. However, we do have time set aside to work on innovation (exploration tasks). I could potentially work on this then (but we've just finished this iteration's task, so the next will be in a month or so). |
🐛 Bug Report
Using the sample proto below, only
default
appears in the output json -example
andpattern
do not.To Reproduce
I'm using
buf
to generate the swagger using the following template:buf.gen.swagger.yaml:
Expected behaviour
Actual Behavior
Your Environment
The text was updated successfully, but these errors were encountered: