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
Add header annotations to OpenAPIv2 generator #2932
Comments
Yep! grpc-gateway/examples/internal/proto/examplepb/a_bit_of_everything.proto Lines 20 to 207 in 38561b3
|
I meant http request headers like say X-Request-ID not security definitions. Per I tried this:
But that isn't working Also i made a simple setup script for a barebones setup https://github.com/amitavaghosh1/setup/tree/main/golang/grpcproj |
It doesn't look like you can specify request headers, no. |
@johanbrandhorst is there any way to add support for this? In the openapiv2.proto file, the message definition is there. Openapi supports request header. So what to do now? |
We'd have to add the definitions for specifying headers into the annotations (here). I'm not actually sure where the header definitions would go, probably on an Once we have the annotation option in place we need to add parsing of the option into the openapiv2 generator, to produce the output in the final file. |
I think we should have a And that goes inside
#2970 If you could have a look. I started working on this. @johanbrandhorst I am not sure how to proceed from here. https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-openapiv2/internal/genopenapi/types.go#L126 here I see some parameters object already specified. I am confused a bit. |
Hm, the problem with using |
Okay. I will try and make those changes. |
Implementation in #3010 |
I am generating openapi v2 documentation. using
buf generate
this is a part of how my proto file looks like. I was wondering if there is any way to use annotations to generate the swagger.json such that it shows up in headers like.
The text was updated successfully, but these errors were encountered: