...

Text file src/github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb/openapi_merge_a.proto

Documentation: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb

     1syntax = "proto3";
     2
     3// Merging Services
     4//
     5// This is an example of merging two proto files.
     6package grpc.gateway.examples.internal.examplepb;
     7
     8import "google/api/annotations.proto";
     9
    10option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb";
    11
    12// InMessageA represents a message to ServiceA and ServiceC.
    13message InMessageA {
    14  // Here is the explanation about InMessageA.values
    15  repeated string values = 1;
    16}
    17
    18// OutMessageA represents a message returned from ServiceA.
    19message OutMessageA {
    20  // Here is the explanation about OutMessageA.value
    21  string value = 1;
    22}
    23
    24// OutMessageC represents a message returned from ServiceC.
    25message OutMessageC {
    26  // Here is the explanation about OutMessageC.value
    27  string value = 1;
    28}
    29
    30// ServiceA provices MethodOne and MethodTwo
    31service ServiceA {
    32  // ServiceA.MethodOne receives InMessageA and returns OutMessageA
    33  //
    34  // Here is the detail explanation about ServiceA.MethodOne.
    35  rpc MethodOne(InMessageA) returns (OutMessageA) {
    36    option (google.api.http) = {
    37      post: "/v1/example/a/1"
    38      body: "*"
    39    };
    40  }
    41  // ServiceA.MethodTwo receives OutMessageA and returns InMessageA
    42  //
    43  // Here is the detail explanation about ServiceA.MethodTwo.
    44  rpc MethodTwo(OutMessageA) returns (InMessageA) {
    45    option (google.api.http) = {
    46      post: "/v1/example/a/2"
    47      body: "*"
    48    };
    49  }
    50}
    51
    52// ServiceC service responds to incoming merge requests.
    53service ServiceC {
    54  // ServiceC.MethodOne receives InMessageA and returns OutMessageC
    55  //
    56  // Here is the detail explanation about ServiceC.MethodOne.
    57  rpc MethodOne(InMessageA) returns (OutMessageC) {
    58    option (google.api.http) = {
    59      post: "/v1/example/c/1"
    60      body: "*"
    61    };
    62  }
    63  // ServiceC.MethodTwo receives OutMessageA and returns InMessageA
    64  //
    65  // Here is the detail explanation about ServiceC.MethodTwo.
    66  rpc MethodTwo(OutMessageA) returns (InMessageA) {
    67    option (google.api.http) = {
    68      post: "/v1/example/c/2"
    69      body: "*"
    70    };
    71  }
    72}

View as plain text