File: openapi_merge_b.proto

package info (click to toggle)
golang-github-grpc-ecosystem-grpc-gateway.v2 2.11.3-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,148 kB
  • sloc: javascript: 352; makefile: 136; sh: 26
file content (44 lines) | stat: -rw-r--r-- 1,229 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
syntax = "proto3";

// Merging Services
//
// This is an example of merging two proto files.
package grpc.gateway.examples.internal.examplepb;

import "google/api/annotations.proto";

option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb";

// InMessageB represents a message to ServiceB.
message InMessageB {
  // Here is the explanation about InMessageB.values
  string value = 1;
}

// OutMessageB represents a message returned from ServiceB.
message OutMessageB {
  // Here is the explanation about OutMessageB.value
  repeated string values = 1;
}

// ServiceB service responds to incoming merge requests.
service ServiceB {
  // ServiceB.MethodOne receives InMessageB and returns OutMessageB
  //
  // Here is the detail explanation about ServiceB.MethodOne.
  rpc MethodOne(InMessageB) returns (OutMessageB) {
    option (google.api.http) = {
      post: "/v1/example/b/1"
      body: "*"
    };
  }
  // ServiceB.MethodTwo receives OutMessageB and returns InMessageB
  //
  // Here is the detail explanation about ServiceB.MethodTwo.
  rpc MethodTwo(OutMessageB) returns (InMessageB) {
    option (google.api.http) = {
      post: "/v1/example/b/2"
      body: "*"
    };
  }
}