Skip to content

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