• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package basic_test;
4
5import "google/protobuf/wrappers.proto";
6import "google/protobuf/timestamp.proto";
7import "google/protobuf/duration.proto";
8import "google/protobuf/struct.proto";
9
10message Foo {
11  Bar bar = 1;
12  repeated Baz baz = 2;
13}
14
15message Bar {
16  string msg = 1;
17}
18
19message Baz {
20  string msg = 1;
21}
22
23message TestMessage {
24  int32 optional_int32 = 1;
25  int64 optional_int64 = 2;
26  uint32 optional_uint32 = 3;
27  uint64 optional_uint64 = 4;
28  bool optional_bool = 5;
29  float optional_float = 6;
30  double optional_double = 7;
31  string optional_string = 8;
32  bytes optional_bytes = 9;
33  TestMessage2 optional_msg = 10;
34  TestEnum optional_enum = 11;
35
36  repeated int32 repeated_int32 = 12;
37  repeated int64 repeated_int64 = 13;
38  repeated uint32 repeated_uint32 = 14;
39  repeated uint64 repeated_uint64 = 15;
40  repeated bool repeated_bool = 16;
41  repeated float repeated_float = 17;
42  repeated double repeated_double = 18;
43  repeated string repeated_string = 19;
44  repeated bytes repeated_bytes = 20;
45  repeated TestMessage2 repeated_msg = 21;
46  repeated TestEnum repeated_enum = 22;
47}
48
49message TestMessage2 {
50  int32 foo = 1;
51}
52
53enum TestEnum {
54  Default = 0;
55  A = 1;
56  B = 2;
57  C = 3;
58}
59
60message TestEmbeddedMessageParent {
61  TestEmbeddedMessageChild child_msg = 1;
62  int32 number = 2;
63
64  repeated TestEmbeddedMessageChild repeated_msg = 3;
65  repeated int32 repeated_number = 4;
66}
67
68message TestEmbeddedMessageChild {
69  TestMessage sub_child = 1;
70}
71
72message Recursive1 {
73  Recursive2 foo = 1;
74}
75
76message Recursive2 {
77  Recursive1 foo = 1;
78}
79
80message MapMessage {
81  map<string, int32> map_string_int32 = 1;
82  map<string, TestMessage2> map_string_msg = 2;
83  map<string, TestEnum> map_string_enum = 3;
84}
85
86message MapMessageWireEquiv {
87  repeated MapMessageWireEquiv_entry1 map_string_int32 = 1;
88  repeated MapMessageWireEquiv_entry2 map_string_msg = 2;
89}
90
91message MapMessageWireEquiv_entry1 {
92  string key = 1;
93  int32 value = 2;
94}
95
96message MapMessageWireEquiv_entry2 {
97  string key = 1;
98  TestMessage2 value = 2;
99}
100
101message OneofMessage {
102  oneof my_oneof {
103    string a = 1;
104    int32 b = 2;
105    TestMessage2 c = 3;
106    TestEnum d = 4;
107  }
108}
109
110message Outer {
111  map<int32, Inner> items = 1;
112}
113
114message Inner {
115}
116
117message Wrapper {
118  google.protobuf.DoubleValue double = 1;
119  google.protobuf.FloatValue float = 2;
120  google.protobuf.Int32Value int32 = 3;
121  google.protobuf.Int64Value int64 = 4;
122  google.protobuf.UInt32Value uint32 = 5;
123  google.protobuf.UInt64Value uint64 = 6;
124  google.protobuf.BoolValue bool = 7;
125  google.protobuf.StringValue string = 8;
126  google.protobuf.BytesValue bytes = 9;
127  string real_string = 100;
128  oneof a_oneof {
129    string oneof_string = 10;
130  }
131}
132
133message TimeMessage {
134  google.protobuf.Timestamp timestamp = 1;
135  google.protobuf.Duration duration = 2;
136}
137
138message Enumer {
139  TestEnum optional_enum = 1;
140  repeated TestEnum repeated_enum = 2;
141  string a_const = 3;
142  oneof a_oneof {
143    string str = 10;
144    TestEnum const = 11;
145  }
146}
147
148message MyRepeatedStruct {
149  repeated MyStruct structs = 1;
150}
151
152message MyStruct {
153  string string = 1;
154  google.protobuf.Struct struct = 2;
155}
156