/
uncommon.proto
77 lines (56 loc) · 1.6 KB
/
uncommon.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
73
74
75
76
77
package uncommon;
import public 'common.proto';
syntax = 'proto3';
option java_package = 'com.google.protobuf';
message Test;
message Test2 {
float hex = 0x1 [default=0x1];
float oct = 02 [default=02];
float zero = 3 [default=0];
float inf = 4 [default=inf];
float nan = 5 [default=nan];
/** pre */
repeated group lower = 6 {}; /// post
/** pre */
map<string,string> ambiguousComments = 7; /// post
string str = 8 {
option default = "a";
}
map<string,string> strmap = 9 {
option (custom) = "";
};
map<uint64,Test> longmap = 10;
int32 optionTest = 11 [(my_options) = { a: "foo" b {} }];
/** pre */
oneof kind;
oneof kind2; /// post
/** pre */
oneof kind3 {
option (custom) = ""; /// post
};
option (custom) = -42;
extend Test;
extend Test{};
extend Test{required int32 a=1;} // not validated by the parser
};
enum Test3;
enum Test4{
option (custom).foo = "";
ONE = 1 [foo="bar"];
TWO = 2 [(my_options) = { a: "foo" b { c: "bar" } }];
THREE = 3 {
option (custom).bar = "";
};
};
enum Test4_1{
OPTION = 1;
}
service Test5;
service Test6 { option (custom).bar = "";
message DoSomethingRequest;
message DoSomethingResponse;
rpc DoSomething(stream DoSomethingRequest) returns (stream DoSomethingResponse){ option (custom).foo2 = ""; };
/** pre */
rpc DoSomethingElse( stream DoSomethingRequest ) returns (DoSomethingResponse); /// post
rpc DoSomethingEntirelyDifferent(DoSomethingRequest ) returns ( stream DoSomethingResponse ); /// post
};