Skip to content
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

支持 proto的rpc方法中定义的parameters.headers 参数,在swagger中展示请求头的参数;方便swagger操作 #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

airunny
Copy link

@airunny airunny commented Jan 18, 2024

…lay HTTP request header parameters in Swagger.

支持 rpc方法中的header 参数;如下

service Service {
  rpc GetUserInfo(GetUserInfoRequest) returns (GetUserInfoReply){
    option (google.api.http) = {get: "/v1/user_info"};
    option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
      summary: "header 参数",
      parameters: {
        headers: [
          {
            name: "X-Country-Code"
            type: STRING,
            description: "The country code"
            required: true
          },
          {
            name: "X-Language-Code"
            type: STRING,
            description: "The Language code"
            required: true
          }
        ]
      };
    };
  }
}

20240118-101849

…lay HTTP request header parameters in Swagger.
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant