-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathopenapi_merge_a.proto
72 lines (64 loc) · 1.97 KB
/
openapi_merge_a.proto
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";
option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb";
// Merging Services
//
// This is an example of merging two proto files.
package grpc.gateway.examples.internal.examplepb;
import "google/api/annotations.proto";
// 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: "*"
};
}
}