|
| 1 | +// Protocol Buffers - Google's data interchange format |
| 2 | +// Copyright 2008 Google Inc. All rights reserved. |
| 3 | +// https://developers.google.com/protocol-buffers/ |
| 4 | +// |
| 5 | +// Redistribution and use in source and binary forms, with or without |
| 6 | +// modification, are permitted provided that the following conditions are |
| 7 | +// met: |
| 8 | +// |
| 9 | +// * Redistributions of source code must retain the above copyright |
| 10 | +// notice, this list of conditions and the following disclaimer. |
| 11 | +// * Redistributions in binary form must reproduce the above |
| 12 | +// copyright notice, this list of conditions and the following disclaimer |
| 13 | +// in the documentation and/or other materials provided with the |
| 14 | +// distribution. |
| 15 | +// * Neither the name of Google Inc. nor the names of its |
| 16 | +// contributors may be used to endorse or promote products derived from |
| 17 | +// this software without specific prior written permission. |
| 18 | +// |
| 19 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 | +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 | +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 | +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 | +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 | +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 | +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | + |
| 31 | +syntax = "proto3"; |
| 32 | + |
| 33 | +package swift_proto_testing.test3; |
| 34 | + |
| 35 | +import "google/protobuf/any.proto"; |
| 36 | +import "google/protobuf/duration.proto"; |
| 37 | +import "google/protobuf/field_mask.proto"; |
| 38 | +import "google/protobuf/struct.proto"; |
| 39 | +import "google/protobuf/timestamp.proto"; |
| 40 | +import "google/protobuf/wrappers.proto"; |
| 41 | + |
| 42 | +// This proto includes every type of field in singular and repeated |
| 43 | +// and optional forms. |
| 44 | +message TestJsonAllTypesProto3 { |
| 45 | + message NestedMessage { |
| 46 | + int32 a = 1; |
| 47 | + TestJsonAllTypesProto3 corecursive = 2; |
| 48 | + } |
| 49 | + |
| 50 | + enum NestedEnum { |
| 51 | + FOO = 0; |
| 52 | + BAR = 1; |
| 53 | + BAZ = 2; |
| 54 | + NEG = -1; // Intentionally negative. |
| 55 | + } |
| 56 | + |
| 57 | + // Singular |
| 58 | + optional int32 optional_int32 = 1; |
| 59 | + optional int64 optional_int64 = 2; |
| 60 | + optional uint32 optional_uint32 = 3; |
| 61 | + optional uint64 optional_uint64 = 4; |
| 62 | + optional sint32 optional_sint32 = 5; |
| 63 | + optional sint64 optional_sint64 = 6; |
| 64 | + optional fixed32 optional_fixed32 = 7; |
| 65 | + optional fixed64 optional_fixed64 = 8; |
| 66 | + optional sfixed32 optional_sfixed32 = 9; |
| 67 | + optional sfixed64 optional_sfixed64 = 10; |
| 68 | + optional float optional_float = 11; |
| 69 | + optional double optional_double = 12; |
| 70 | + optional bool optional_bool = 13; |
| 71 | + optional string optional_string = 14; |
| 72 | + optional bytes optional_bytes = 15; |
| 73 | + |
| 74 | + optional NestedMessage optional_nested_message = 16; |
| 75 | + |
| 76 | + optional NestedEnum optional_nested_enum = 17; |
| 77 | + |
| 78 | + int32 singular_int32 = 18; |
| 79 | + int64 singular_int64 = 19; |
| 80 | + uint32 singular_uint32 = 20; |
| 81 | + uint64 singular_uint64 = 21; |
| 82 | + sint32 singular_sint32 = 22; |
| 83 | + sint64 singular_sint64 = 23; |
| 84 | + fixed32 singular_fixed32 = 24; |
| 85 | + fixed64 singular_fixed64 = 25; |
| 86 | + sfixed32 singular_sfixed32 = 26; |
| 87 | + sfixed64 singular_sfixed64 = 27; |
| 88 | + float singular_float = 28; |
| 89 | + double singular_double = 29; |
| 90 | + bool singular_bool = 30; |
| 91 | + string singular_string = 31; |
| 92 | + bytes singular_bytes = 32; |
| 93 | + |
| 94 | + NestedMessage singular_nested_message = 33; |
| 95 | + |
| 96 | + NestedEnum singular_nested_enum = 34; |
| 97 | + |
| 98 | + |
| 99 | + // Repeated |
| 100 | + repeated int32 repeated_int32 = 35; |
| 101 | + repeated int64 repeated_int64 = 36; |
| 102 | + repeated uint32 repeated_uint32 = 37; |
| 103 | + repeated uint64 repeated_uint64 = 38; |
| 104 | + repeated sint32 repeated_sint32 = 39; |
| 105 | + repeated sint64 repeated_sint64 = 40; |
| 106 | + repeated fixed32 repeated_fixed32 = 41; |
| 107 | + repeated fixed64 repeated_fixed64 = 42; |
| 108 | + repeated sfixed32 repeated_sfixed32 = 43; |
| 109 | + repeated sfixed64 repeated_sfixed64 = 44; |
| 110 | + repeated float repeated_float = 45; |
| 111 | + repeated double repeated_double = 46; |
| 112 | + repeated bool repeated_bool = 47; |
| 113 | + repeated string repeated_string = 48; |
| 114 | + repeated bytes repeated_bytes = 49; |
| 115 | + |
| 116 | + repeated NestedMessage repeated_nested_message = 50; |
| 117 | + |
| 118 | + repeated NestedEnum repeated_nested_enum = 51; |
| 119 | + |
| 120 | + // Map |
| 121 | + map<int32, int32> map_int32_int32 = 56; |
| 122 | + map<int64, int64> map_int64_int64 = 57; |
| 123 | + map<uint32, uint32> map_uint32_uint32 = 58; |
| 124 | + map<uint64, uint64> map_uint64_uint64 = 59; |
| 125 | + map<sint32, sint32> map_sint32_sint32 = 60; |
| 126 | + map<sint64, sint64> map_sint64_sint64 = 61; |
| 127 | + map<fixed32, fixed32> map_fixed32_fixed32 = 62; |
| 128 | + map<fixed64, fixed64> map_fixed64_fixed64 = 63; |
| 129 | + map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 64; |
| 130 | + map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 65; |
| 131 | + map<int32, float> map_int32_float = 66; |
| 132 | + map<int32, double> map_int32_double = 67; |
| 133 | + map<bool, bool> map_bool_bool = 68; |
| 134 | + map<string, string> map_string_string = 69; |
| 135 | + map<string, bytes> map_string_bytes = 70; |
| 136 | + map<string, NestedMessage> map_string_nested_message = 71; |
| 137 | + map<string, NestedEnum> map_string_nested_enum = 73; |
| 138 | + |
| 139 | + oneof oneof_field { |
| 140 | + uint32 oneof_uint32 = 111; |
| 141 | + NestedMessage oneof_nested_message = 112; |
| 142 | + string oneof_string = 113; |
| 143 | + bytes oneof_bytes = 114; |
| 144 | + bool oneof_bool = 115; |
| 145 | + uint64 oneof_uint64 = 116; |
| 146 | + float oneof_float = 117; |
| 147 | + double oneof_double = 118; |
| 148 | + NestedEnum oneof_enum = 119; |
| 149 | + google.protobuf.NullValue oneof_null_value = 120; |
| 150 | + } |
| 151 | + |
| 152 | + // Well-known types |
| 153 | + google.protobuf.BoolValue optional_bool_wrapper = 201; |
| 154 | + google.protobuf.Int32Value optional_int32_wrapper = 202; |
| 155 | + google.protobuf.Int64Value optional_int64_wrapper = 203; |
| 156 | + google.protobuf.UInt32Value optional_uint32_wrapper = 204; |
| 157 | + google.protobuf.UInt64Value optional_uint64_wrapper = 205; |
| 158 | + google.protobuf.FloatValue optional_float_wrapper = 206; |
| 159 | + google.protobuf.DoubleValue optional_double_wrapper = 207; |
| 160 | + google.protobuf.StringValue optional_string_wrapper = 208; |
| 161 | + google.protobuf.BytesValue optional_bytes_wrapper = 209; |
| 162 | + |
| 163 | + repeated google.protobuf.BoolValue repeated_bool_wrapper = 211; |
| 164 | + repeated google.protobuf.Int32Value repeated_int32_wrapper = 212; |
| 165 | + repeated google.protobuf.Int64Value repeated_int64_wrapper = 213; |
| 166 | + repeated google.protobuf.UInt32Value repeated_uint32_wrapper = 214; |
| 167 | + repeated google.protobuf.UInt64Value repeated_uint64_wrapper = 215; |
| 168 | + repeated google.protobuf.FloatValue repeated_float_wrapper = 216; |
| 169 | + repeated google.protobuf.DoubleValue repeated_double_wrapper = 217; |
| 170 | + repeated google.protobuf.StringValue repeated_string_wrapper = 218; |
| 171 | + repeated google.protobuf.BytesValue repeated_bytes_wrapper = 219; |
| 172 | + |
| 173 | + optional google.protobuf.Duration optional_duration = 301; |
| 174 | + optional google.protobuf.Timestamp optional_timestamp = 302; |
| 175 | + optional google.protobuf.FieldMask optional_field_mask = 303; |
| 176 | + optional google.protobuf.Struct optional_struct = 304; |
| 177 | + optional google.protobuf.Any optional_any = 305; |
| 178 | + optional google.protobuf.Value optional_value = 306; |
| 179 | + optional google.protobuf.NullValue optional_null_value = 307; |
| 180 | + |
| 181 | + repeated google.protobuf.Duration repeated_duration = 311; |
| 182 | + repeated google.protobuf.Timestamp repeated_timestamp = 312; |
| 183 | + repeated google.protobuf.FieldMask repeated_fieldmask = 313; |
| 184 | + repeated google.protobuf.Struct repeated_struct = 324; |
| 185 | + repeated google.protobuf.Any repeated_any = 315; |
| 186 | + repeated google.protobuf.Value repeated_value = 316; |
| 187 | + repeated google.protobuf.ListValue repeated_list_value = 317; |
| 188 | + |
| 189 | + // Test field-name-to-JSON-name convention. |
| 190 | + // (protobuf says names can be any valid C/C++ identifier.) |
| 191 | + int32 fieldname1 = 401; |
| 192 | + int32 field_name2 = 402; |
| 193 | + int32 _field_name3 = 403; |
| 194 | + int32 field__name4_ = 404; |
| 195 | + int32 field0name5 = 405; |
| 196 | + int32 field_0_name6 = 406; |
| 197 | + int32 fieldName7 = 407; |
| 198 | + int32 FieldName8 = 408; |
| 199 | + int32 field_Name9 = 409; |
| 200 | + int32 Field_Name10 = 410; |
| 201 | + int32 FIELD_NAME11 = 411; |
| 202 | + int32 FIELD_name12 = 412; |
| 203 | + int32 __field_name13 = 413; |
| 204 | + int32 __Field_name14 = 414; |
| 205 | + int32 field__name15 = 415; |
| 206 | + int32 field__Name16 = 416; |
| 207 | + int32 field_name17__ = 417; |
| 208 | + int32 Field_name18__ = 418; |
| 209 | + |
| 210 | + // Reserved for testing unknown fields |
| 211 | + reserved 501 to 510; |
| 212 | +} |
0 commit comments