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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
|
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
// These proto descriptors have at one time been reported as an issue or defect.
// They are kept here to replicate the issue, and continue to verify the fix.
// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer
// library types are qualified
package unittest_issues;
import "google/protobuf/struct.proto";
option csharp_namespace = "UnitTest.Issues.TestProtos";
// Issue 307: when generating doubly-nested types, any references
// should be of the form A.Types.B.Types.C.
message Issue307 {
message NestedOnce {
message NestedTwice {}
}
}
// Old issue 13:
// http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 New issue
// 309: https://github.com/protocolbuffers/protobuf/issues/309
// message A {
// optional int32 _A = 1;
// }
// message B {
// optional int32 B_ = 1;
// }
// message AB {
// optional int32 a_b = 1;
// }
// Similar issue with numeric names
// Java code failed too, so probably best for this to be a restriction.
// See https://github.com/protocolbuffers/protobuf/issues/308
// message NumberField {
// optional int32 _01 = 1;
// }
// issue 19 - negative enum values
enum NegativeEnum {
NEGATIVE_ENUM_ZERO = 0;
FiveBelow = -5;
MinusOne = -1;
}
message NegativeEnumMessage {
NegativeEnum value = 1;
repeated NegativeEnum values = 2 [packed = false];
repeated NegativeEnum packed_values = 3 [packed = true];
}
// Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21
// Decorate fields with [deprecated=true] as [System.Obsolete]
message DeprecatedChild {
option deprecated = true;
}
enum DeprecatedEnum {
option deprecated = true;
DEPRECATED_ZERO = 0 [deprecated = true];
one = 1;
}
message DeprecatedFieldsMessage {
int32 PrimitiveValue = 1 [deprecated = true];
repeated int32 PrimitiveArray = 2 [deprecated = true];
DeprecatedChild MessageValue = 3 [deprecated = true];
repeated DeprecatedChild MessageArray = 4 [deprecated = true];
DeprecatedEnum EnumValue = 5 [deprecated = true];
repeated DeprecatedEnum EnumArray = 6 [deprecated = true];
}
// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
message ItemField {
int32 item = 1;
}
message ReservedNames {
// Force a nested type called Types
message SomeNestedType {}
int32 types = 1;
int32 descriptor = 2;
}
message TestJsonFieldOrdering {
// These fields are deliberately not declared in numeric
// order, and the oneof fields aren't contiguous either.
// This allows for reasonably robust tests of JSON output
// ordering.
// TestFieldOrderings in unittest_proto3.proto is similar,
// but doesn't include oneofs.
// TODO: Consider adding oneofs to TestFieldOrderings, although
// that will require fixing other tests in multiple platforms.
// Alternatively, consider just adding this to
// unittest_proto3.proto if multiple platforms want it.
int32 plain_int32 = 4;
oneof o1 {
string o1_string = 2;
int32 o1_int32 = 5;
}
string plain_string = 1;
oneof o2 {
int32 o2_int32 = 6;
string o2_string = 3;
}
}
message TestJsonName {
// Message for testing the effects for of the json_name option
string name = 1;
string description = 2 [json_name = "desc"];
string guid = 3 [json_name = "exid"];
}
// Issue 3200: When merging two messages which use the same
// oneof case, which is itself a message type, the submessages should
// be merged.
message OneofMerging {
message Nested {
int32 x = 1;
int32 y = 2;
}
oneof value {
string text = 1;
Nested nested = 2;
}
}
message NullValueOutsideStruct {
oneof value {
string string_value = 1;
google.protobuf.NullValue null_value = 2;
}
}
message NullValueNotInOneof {
google.protobuf.NullValue null_value = 2;
}
message MixedRegularAndOptional {
string regular_field = 1;
optional string optional_field = 2;
}
message OneofWithNoneField {
oneof test {
string x = 1;
string none = 2;
}
}
message OneofWithNoneName {
oneof none {
string x = 1;
string y = 2;
}
}
// Issue 8810
message DisambiguateCommonMembers {
int32 disambiguate_common_members = 1;
int32 types = 2;
int32 descriptor = 3;
int32 equals = 4;
int32 to_string = 5;
int32 get_hash_code = 6;
int32 write_to = 7;
int32 clone = 8;
int32 calculate_size = 9;
int32 merge_from = 10;
int32 on_construction = 11;
int32 parser = 12;
}
message Issue11987Message {
int32 a = 1 [json_name = 'b'];
int32 b = 2 [json_name = 'a'];
int32 c = 3 [json_name = 'd'];
}
|