File: openapi_merge_a.proto

package info (click to toggle)
golang-github-grpc-ecosystem-grpc-gateway 2.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,236 kB
  • sloc: javascript: 357; makefile: 147; sh: 26
file content (72 lines) | stat: -rw-r--r-- 2,021 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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";

// InMessageA represents a message to ServiceA and ServiceC.
message InMessageA {
  // Here is the explanation about InMessageA.values
  repeated string values = 1;
}

// OutMessageA represents a message returned from ServiceA.
message OutMessageA {
  // Here is the explanation about OutMessageA.value
  string value = 1;
}

// OutMessageC represents a message returned from ServiceC.
message OutMessageC {
  // Here is the explanation about OutMessageC.value
  string value = 1;
}

// ServiceA provices MethodOne and MethodTwo
service ServiceA {
  // ServiceA.MethodOne receives InMessageA and returns OutMessageA
  //
  // Here is the detail explanation about ServiceA.MethodOne.
  rpc MethodOne(InMessageA) returns (OutMessageA) {
    option (google.api.http) = {
      post: "/v1/example/a/1"
      body: "*"
    };
  }
  // ServiceA.MethodTwo receives OutMessageA and returns InMessageA
  //
  // Here is the detail explanation about ServiceA.MethodTwo.
  rpc MethodTwo(OutMessageA) returns (InMessageA) {
    option (google.api.http) = {
      post: "/v1/example/a/2"
      body: "*"
    };
  }
}

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