github.com/Big-big-orange/protoreflect@v0.0.0-20240408141420-285cedfdf6a4/desc/protoprint/testfiles/descriptor-sorted-AND-multiline-style-comments.proto (about) 1 /* 2 * Protocol Buffers - Google's data interchange format 3 * Copyright 2008 Google Inc. All rights reserved. 4 * https://developers.google.com/protocol-buffers/ 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: 9 * 10 * * Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * * Redistributions in binary form must reproduce the above 13 * copyright notice, this list of conditions and the following disclaimer 14 * in the documentation and/or other materials provided with the 15 * distribution. 16 * * Neither the name of Google Inc. nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 /* 34 * Author: kenton@google.com (Kenton Varda) 35 * Based on original Protocol Buffers design by 36 * Sanjay Ghemawat, Jeff Dean, and others. 37 * 38 * The messages in this file describe the definitions found in .proto files. 39 * A valid .proto file can be translated directly to a FileDescriptorProto 40 * without any other information (e.g. without reading its imports). 41 */ 42 43 syntax = "proto2"; 44 45 package google.protobuf; 46 47 option cc_enable_arenas = true; 48 49 option csharp_namespace = "Google.Protobuf.Reflection"; 50 51 option go_package = "google.golang.org/protobuf/types/descriptorpb"; 52 53 option java_outer_classname = "DescriptorProtos"; 54 55 option java_package = "com.google.protobuf"; 56 57 option objc_class_prefix = "GPB"; 58 59 /* 60 * descriptor.proto must be optimized for speed because reflection-based 61 * algorithms don't work during bootstrapping. 62 */ 63 option optimize_for = SPEED; 64 65 /* Describes a message type. */ 66 message DescriptorProto { 67 optional string name = 1; 68 69 repeated FieldDescriptorProto field = 2; 70 71 repeated DescriptorProto nested_type = 3; 72 73 repeated EnumDescriptorProto enum_type = 4; 74 75 repeated ExtensionRange extension_range = 5; 76 77 repeated FieldDescriptorProto extension = 6; 78 79 optional MessageOptions options = 7; 80 81 repeated OneofDescriptorProto oneof_decl = 8; 82 83 repeated ReservedRange reserved_range = 9; 84 85 /* 86 * Reserved field names, which may not be used by fields in the same message. 87 * A given name may only be reserved once. 88 */ 89 repeated string reserved_name = 10; 90 91 message ExtensionRange { 92 optional int32 start = 1; /* Inclusive. */ 93 94 optional int32 end = 2; /* Exclusive. */ 95 96 optional ExtensionRangeOptions options = 3; 97 } 98 99 /* 100 * Range of reserved tag numbers. Reserved tag numbers may not be used by 101 * fields or extension ranges in the same message. Reserved ranges may 102 * not overlap. 103 */ 104 message ReservedRange { 105 optional int32 start = 1; /* Inclusive. */ 106 107 optional int32 end = 2; /* Exclusive. */ 108 } 109 } 110 111 /* Describes an enum type. */ 112 message EnumDescriptorProto { 113 optional string name = 1; 114 115 repeated EnumValueDescriptorProto value = 2; 116 117 optional EnumOptions options = 3; 118 119 /* 120 * Range of reserved numeric values. Reserved numeric values may not be used 121 * by enum values in the same enum declaration. Reserved ranges may not 122 * overlap. 123 */ 124 repeated EnumReservedRange reserved_range = 4; 125 126 /* 127 * Reserved enum value names, which may not be reused. A given name may only 128 * be reserved once. 129 */ 130 repeated string reserved_name = 5; 131 132 /* 133 * Range of reserved numeric values. Reserved values may not be used by 134 * entries in the same enum. Reserved ranges may not overlap. 135 * 136 * Note that this is distinct from DescriptorProto.ReservedRange in that it 137 * is inclusive such that it can appropriately represent the entire int32 138 * domain. 139 */ 140 message EnumReservedRange { 141 optional int32 start = 1; /* Inclusive. */ 142 143 optional int32 end = 2; /* Inclusive. */ 144 } 145 } 146 147 message EnumOptions { 148 /* 149 * Set this option to true to allow mapping different tag names to the same 150 * value. 151 */ 152 optional bool allow_alias = 2; 153 154 /* 155 * Is this enum deprecated? 156 * Depending on the target platform, this can emit Deprecated annotations 157 * for the enum, or it will be completely ignored; in the very least, this 158 * is a formalization for deprecating enums. 159 */ 160 optional bool deprecated = 3 [default = false]; 161 162 /* 163 * Enable the legacy handling of JSON field name conflicts. This lowercases 164 * and strips underscored from the fields before comparison in proto3 only. 165 * The new behavior takes `json_name` into account and applies to proto2 as 166 * well. 167 * TODO Remove this legacy behavior once downstream teams have 168 * had time to migrate. 169 */ 170 optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; 171 172 /* Any features defined in the specific edition. */ 173 optional FeatureSet features = 7; 174 175 /* The parser stores options it doesn't recognize here. See above. */ 176 repeated UninterpretedOption uninterpreted_option = 999; 177 178 extensions 1000 to max; 179 180 reserved 5; 181 } 182 183 /* Describes a value within an enum. */ 184 message EnumValueDescriptorProto { 185 optional string name = 1; 186 187 optional int32 number = 2; 188 189 optional EnumValueOptions options = 3; 190 } 191 192 message EnumValueOptions { 193 /* 194 * Is this enum value deprecated? 195 * Depending on the target platform, this can emit Deprecated annotations 196 * for the enum value, or it will be completely ignored; in the very least, 197 * this is a formalization for deprecating enum values. 198 */ 199 optional bool deprecated = 1 [default = false]; 200 201 /* Any features defined in the specific edition. */ 202 optional FeatureSet features = 2; 203 204 /* 205 * Indicate that fields annotated with this enum value should not be printed 206 * out when using debug formats, e.g. when the field contains sensitive 207 * credentials. 208 */ 209 optional bool debug_redact = 3 [default = false]; 210 211 /* The parser stores options it doesn't recognize here. See above. */ 212 repeated UninterpretedOption uninterpreted_option = 999; 213 214 extensions 1000 to max; 215 } 216 217 message ExtensionRangeOptions { 218 /* 219 * For external users: DO NOT USE. We are in the process of open sourcing 220 * extension declaration and executing internal cleanups before it can be 221 * used externally. 222 */ 223 repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; 224 225 /* 226 * The verification state of the range. 227 * TODO: flip the default to DECLARATION once all empty ranges 228 * are marked as UNVERIFIED. 229 */ 230 optional VerificationState verification = 3 [default = UNVERIFIED]; 231 232 /* Any features defined in the specific edition. */ 233 optional FeatureSet features = 50; 234 235 /* The parser stores options it doesn't recognize here. See above. */ 236 repeated UninterpretedOption uninterpreted_option = 999; 237 238 message Declaration { 239 /* The extension number declared within the extension range. */ 240 optional int32 number = 1; 241 242 /* 243 * The fully-qualified name of the extension field. There must be a leading 244 * dot in front of the full name. 245 */ 246 optional string full_name = 2; 247 248 /* 249 * The fully-qualified type name of the extension field. Unlike 250 * Metadata.type, Declaration.type must have a leading dot for messages 251 * and enums. 252 */ 253 optional string type = 3; 254 255 /* 256 * If true, indicates that the number is reserved in the extension range, 257 * and any extension field with the number will fail to compile. Set this 258 * when a declared extension field is deleted. 259 */ 260 optional bool reserved = 5; 261 262 /* 263 * If true, indicates that the extension must be defined as repeated. 264 * Otherwise the extension must be defined as optional. 265 */ 266 optional bool repeated = 6; 267 268 reserved 4; 269 } 270 271 /* The verification state of the extension range. */ 272 enum VerificationState { 273 /* All the extensions of the range must be declared. */ 274 DECLARATION = 0; 275 276 UNVERIFIED = 1; 277 } 278 279 extensions 1000 to max; 280 } 281 282 /* 283 * =================================================================== 284 * Features 285 */ 286 287 /* 288 * TODO Enums in C++ gencode (and potentially other languages) are 289 * not well scoped. This means that each of the feature enums below can clash 290 * with each other. The short names we've chosen maximize call-site 291 * readability, but leave us very open to this scenario. A future feature will 292 * be designed and implemented to handle this, hopefully before we ever hit a 293 * conflict here. 294 */ 295 message FeatureSet { 296 optional FieldPresence field_presence = 1 [ 297 edition_defaults = { value: "EXPLICIT", edition: EDITION_PROTO2 }, 298 edition_defaults = { value: "IMPLICIT", edition: EDITION_PROTO3 }, 299 edition_defaults = { value: "EXPLICIT", edition: EDITION_2023 }, 300 retention = RETENTION_RUNTIME, 301 targets = TARGET_TYPE_FIELD, 302 targets = TARGET_TYPE_FILE 303 ]; 304 305 optional EnumType enum_type = 2 [ 306 edition_defaults = { value: "CLOSED", edition: EDITION_PROTO2 }, 307 edition_defaults = { value: "OPEN", edition: EDITION_PROTO3 }, 308 retention = RETENTION_RUNTIME, 309 targets = TARGET_TYPE_ENUM, 310 targets = TARGET_TYPE_FILE 311 ]; 312 313 optional RepeatedFieldEncoding repeated_field_encoding = 3 [ 314 edition_defaults = { value: "EXPANDED", edition: EDITION_PROTO2 }, 315 edition_defaults = { value: "PACKED", edition: EDITION_PROTO3 }, 316 retention = RETENTION_RUNTIME, 317 targets = TARGET_TYPE_FIELD, 318 targets = TARGET_TYPE_FILE 319 ]; 320 321 optional Utf8Validation utf8_validation = 4 [ 322 edition_defaults = { value: "NONE", edition: EDITION_PROTO2 }, 323 edition_defaults = { value: "VERIFY", edition: EDITION_PROTO3 }, 324 retention = RETENTION_RUNTIME, 325 targets = TARGET_TYPE_FIELD, 326 targets = TARGET_TYPE_FILE 327 ]; 328 329 optional MessageEncoding message_encoding = 5 [ 330 edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_PROTO2 }, 331 retention = RETENTION_RUNTIME, 332 targets = TARGET_TYPE_FIELD, 333 targets = TARGET_TYPE_FILE 334 ]; 335 336 optional JsonFormat json_format = 6 [ 337 edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_PROTO2 }, 338 edition_defaults = { value: "ALLOW", edition: EDITION_PROTO3 }, 339 retention = RETENTION_RUNTIME, 340 targets = TARGET_TYPE_MESSAGE, 341 targets = TARGET_TYPE_ENUM, 342 targets = TARGET_TYPE_FILE 343 ]; 344 345 enum EnumType { 346 ENUM_TYPE_UNKNOWN = 0; 347 348 OPEN = 1; 349 350 CLOSED = 2; 351 } 352 353 enum FieldPresence { 354 FIELD_PRESENCE_UNKNOWN = 0; 355 356 EXPLICIT = 1; 357 358 IMPLICIT = 2; 359 360 LEGACY_REQUIRED = 3; 361 } 362 363 enum JsonFormat { 364 JSON_FORMAT_UNKNOWN = 0; 365 366 ALLOW = 1; 367 368 LEGACY_BEST_EFFORT = 2; 369 } 370 371 enum MessageEncoding { 372 MESSAGE_ENCODING_UNKNOWN = 0; 373 374 LENGTH_PREFIXED = 1; 375 376 DELIMITED = 2; 377 } 378 379 enum RepeatedFieldEncoding { 380 REPEATED_FIELD_ENCODING_UNKNOWN = 0; 381 382 PACKED = 1; 383 384 EXPANDED = 2; 385 } 386 387 enum Utf8Validation { 388 UTF8_VALIDATION_UNKNOWN = 0; 389 390 NONE = 1; 391 392 VERIFY = 2; 393 } 394 395 extensions 1000, 1001, 9995 to 9999; 396 397 reserved 999; 398 } 399 400 /* 401 * A compiled specification for the defaults of a set of features. These 402 * messages are generated from FeatureSet extensions and can be used to seed 403 * feature resolution. The resolution with this object becomes a simple search 404 * for the closest matching edition, followed by proto merges. 405 */ 406 message FeatureSetDefaults { 407 repeated FeatureSetEditionDefault defaults = 1; 408 409 /* 410 * The minimum supported edition (inclusive) when this was constructed. 411 * Editions before this will not have defaults. 412 */ 413 optional Edition minimum_edition = 4; 414 415 /* 416 * The maximum known edition (inclusive) when this was constructed. Editions 417 * after this will not have reliable defaults. 418 */ 419 optional Edition maximum_edition = 5; 420 421 /* 422 * A map from every known edition with a unique set of defaults to its 423 * defaults. Not all editions may be contained here. For a given edition, 424 * the defaults at the closest matching edition ordered at or before it should 425 * be used. This field must be in strict ascending order by edition. 426 */ 427 message FeatureSetEditionDefault { 428 optional FeatureSet features = 2; 429 430 optional Edition edition = 3; 431 } 432 } 433 434 /* Describes a field within a message. */ 435 message FieldDescriptorProto { 436 optional string name = 1; 437 438 /* 439 * For extensions, this is the name of the type being extended. It is 440 * resolved in the same manner as type_name. 441 */ 442 optional string extendee = 2; 443 444 optional int32 number = 3; 445 446 optional Label label = 4; 447 448 /* 449 * If type_name is set, this need not be set. If both this and type_name 450 * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. 451 */ 452 optional Type type = 5; 453 454 /* 455 * For message and enum types, this is the name of the type. If the name 456 * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping 457 * rules are used to find the type (i.e. first the nested types within this 458 * message are searched, then within the parent, on up to the root 459 * namespace). 460 */ 461 optional string type_name = 6; 462 463 /* 464 * For numeric types, contains the original text representation of the value. 465 * For booleans, "true" or "false". 466 * For strings, contains the default text contents (not escaped in any way). 467 * For bytes, contains the C escaped value. All bytes >= 128 are escaped. 468 */ 469 optional string default_value = 7; 470 471 optional FieldOptions options = 8; 472 473 /* 474 * If set, gives the index of a oneof in the containing type's oneof_decl 475 * list. This field is a member of that oneof. 476 */ 477 optional int32 oneof_index = 9; 478 479 /* 480 * JSON name of this field. The value is set by protocol compiler. If the 481 * user has set a "json_name" option on this field, that option's value 482 * will be used. Otherwise, it's deduced from the field's name by converting 483 * it to camelCase. 484 */ 485 optional string json_name = 10; 486 487 /* 488 * If true, this is a proto3 "optional". When a proto3 field is optional, it 489 * tracks presence regardless of field type. 490 * 491 * When proto3_optional is true, this field must be belong to a oneof to 492 * signal to old proto3 clients that presence is tracked for this field. This 493 * oneof is known as a "synthetic" oneof, and this field must be its sole 494 * member (each proto3 optional field gets its own synthetic oneof). Synthetic 495 * oneofs exist in the descriptor only, and do not generate any API. Synthetic 496 * oneofs must be ordered after all "real" oneofs. 497 * 498 * For message fields, proto3_optional doesn't create any semantic change, 499 * since non-repeated message fields always track presence. However it still 500 * indicates the semantic detail of whether the user wrote "optional" or not. 501 * This can be useful for round-tripping the .proto file. For consistency we 502 * give message fields a synthetic oneof also, even though it is not required 503 * to track presence. This is especially important because the parser can't 504 * tell if a field is a message or an enum, so it must always create a 505 * synthetic oneof. 506 * 507 * Proto2 optional fields do not set this flag, because they already indicate 508 * optional with `LABEL_OPTIONAL`. 509 */ 510 optional bool proto3_optional = 17; 511 512 enum Label { 513 /* 0 is reserved for errors */ 514 LABEL_OPTIONAL = 1; 515 516 /* 517 * The required label is only allowed in google.protobuf. In proto3 and Editions 518 * it's explicitly prohibited. In Editions, the `field_presence` feature 519 * can be used to get this behavior. 520 */ 521 LABEL_REQUIRED = 2; 522 523 LABEL_REPEATED = 3; 524 } 525 526 enum Type { 527 /* 528 * 0 is reserved for errors. 529 * Order is weird for historical reasons. 530 */ 531 TYPE_DOUBLE = 1; 532 533 TYPE_FLOAT = 2; 534 535 /* 536 * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if 537 * negative values are likely. 538 */ 539 TYPE_INT64 = 3; 540 541 TYPE_UINT64 = 4; 542 543 /* 544 * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if 545 * negative values are likely. 546 */ 547 TYPE_INT32 = 5; 548 549 TYPE_FIXED64 = 6; 550 551 TYPE_FIXED32 = 7; 552 553 TYPE_BOOL = 8; 554 555 TYPE_STRING = 9; 556 557 /* 558 * Tag-delimited aggregate. 559 * Group type is deprecated and not supported after google.protobuf. However, Proto3 560 * implementations should still be able to parse the group wire format and 561 * treat group fields as unknown fields. In Editions, the group wire format 562 * can be enabled via the `message_encoding` feature. 563 */ 564 TYPE_GROUP = 10; 565 566 TYPE_MESSAGE = 11; /* Length-delimited aggregate. */ 567 568 /* New in version 2. */ 569 TYPE_BYTES = 12; 570 571 TYPE_UINT32 = 13; 572 573 TYPE_ENUM = 14; 574 575 TYPE_SFIXED32 = 15; 576 577 TYPE_SFIXED64 = 16; 578 579 TYPE_SINT32 = 17; /* Uses ZigZag encoding. */ 580 581 TYPE_SINT64 = 18; /* Uses ZigZag encoding. */ 582 } 583 } 584 585 message FieldOptions { 586 /* 587 * The ctype option instructs the C++ code generator to use a different 588 * representation of the field than it normally would. See the specific 589 * options below. This option is only implemented to support use of 590 * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of 591 * type "bytes" in the open source release -- sorry, we'll try to include 592 * other types in a future version! 593 */ 594 optional CType ctype = 1 [default = STRING]; 595 596 /* 597 * The packed option can be enabled for repeated primitive fields to enable 598 * a more efficient representation on the wire. Rather than repeatedly 599 * writing the tag and type for each element, the entire array is encoded as 600 * a single length-delimited blob. In proto3, only explicit setting it to 601 * false will avoid using packed encoding. This option is prohibited in 602 * Editions, but the `repeated_field_encoding` feature can be used to control 603 * the behavior. 604 */ 605 optional bool packed = 2; 606 607 /* 608 * Is this field deprecated? 609 * Depending on the target platform, this can emit Deprecated annotations 610 * for accessors, or it will be completely ignored; in the very least, this 611 * is a formalization for deprecating fields. 612 */ 613 optional bool deprecated = 3 [default = false]; 614 615 /* 616 * Should this field be parsed lazily? Lazy applies only to message-type 617 * fields. It means that when the outer message is initially parsed, the 618 * inner message's contents will not be parsed but instead stored in encoded 619 * form. The inner message will actually be parsed when it is first accessed. 620 * 621 * This is only a hint. Implementations are free to choose whether to use 622 * eager or lazy parsing regardless of the value of this option. However, 623 * setting this option true suggests that the protocol author believes that 624 * using lazy parsing on this field is worth the additional bookkeeping 625 * overhead typically needed to implement it. 626 * 627 * This option does not affect the public interface of any generated code; 628 * all method signatures remain the same. Furthermore, thread-safety of the 629 * interface is not affected by this option; const methods remain safe to 630 * call from multiple threads concurrently, while non-const methods continue 631 * to require exclusive access. 632 * 633 * Note that implementations may choose not to check required fields within 634 * a lazy sub-message. That is, calling IsInitialized() on the outer message 635 * may return true even if the inner message has missing required fields. 636 * This is necessary because otherwise the inner message would have to be 637 * parsed in order to perform the check, defeating the purpose of lazy 638 * parsing. An implementation which chooses not to check required fields 639 * must be consistent about it. That is, for any particular sub-message, the 640 * implementation must either *always* check its required fields, or *never* 641 * check its required fields, regardless of whether or not the message has 642 * been parsed. 643 * 644 * As of May 2022, lazy verifies the contents of the byte stream during 645 * parsing. An invalid byte stream will cause the overall parsing to fail. 646 */ 647 optional bool lazy = 5 [default = false]; 648 649 /* 650 * The jstype option determines the JavaScript type used for values of the 651 * field. The option is permitted only for 64 bit integral and fixed types 652 * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING 653 * is represented as JavaScript string, which avoids loss of precision that 654 * can happen when a large value is converted to a floating point JavaScript. 655 * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to 656 * use the JavaScript "number" type. The behavior of the default option 657 * JS_NORMAL is implementation dependent. 658 * 659 * This option is an enum to permit additional types to be added, e.g. 660 * goog.math.Integer. 661 */ 662 optional JSType jstype = 6 [default = JS_NORMAL]; 663 664 /* For Google-internal migration only. Do not use. */ 665 optional bool weak = 10 [default = false]; 666 667 /* 668 * unverified_lazy does no correctness checks on the byte stream. This should 669 * only be used where lazy with verification is prohibitive for performance 670 * reasons. 671 */ 672 optional bool unverified_lazy = 15 [default = false]; 673 674 /* 675 * Indicate that the field value should not be printed out when using debug 676 * formats, e.g. when the field contains sensitive credentials. 677 */ 678 optional bool debug_redact = 16 [default = false]; 679 680 optional OptionRetention retention = 17; 681 682 repeated OptionTargetType targets = 19; 683 684 repeated EditionDefault edition_defaults = 20; 685 686 /* Any features defined in the specific edition. */ 687 optional FeatureSet features = 21; 688 689 /* The parser stores options it doesn't recognize here. See above. */ 690 repeated UninterpretedOption uninterpreted_option = 999; 691 692 message EditionDefault { 693 optional string value = 2; /* Textproto value. */ 694 695 optional Edition edition = 3; 696 } 697 698 enum CType { 699 /* Default mode. */ 700 STRING = 0; 701 702 /* 703 * The option [ctype=CORD] may be applied to a non-repeated field of type 704 * "bytes". It indicates that in C++, the data should be stored in a Cord 705 * instead of a string. For very large strings, this may reduce memory 706 * fragmentation. It may also allow better performance when parsing from a 707 * Cord, or when parsing with aliasing enabled, as the parsed Cord may then 708 * alias the original buffer. 709 */ 710 CORD = 1; 711 712 STRING_PIECE = 2; 713 } 714 715 enum JSType { 716 /* Use the default type. */ 717 JS_NORMAL = 0; 718 719 /* Use JavaScript strings. */ 720 JS_STRING = 1; 721 722 /* Use JavaScript numbers. */ 723 JS_NUMBER = 2; 724 } 725 726 /* 727 * If set to RETENTION_SOURCE, the option will be omitted from the binary. 728 * Note: as of January 2023, support for this is in progress and does not yet 729 * have an effect (b/264593489). 730 */ 731 enum OptionRetention { 732 RETENTION_UNKNOWN = 0; 733 734 RETENTION_RUNTIME = 1; 735 736 RETENTION_SOURCE = 2; 737 } 738 739 /* 740 * This indicates the types of entities that the field may apply to when used 741 * as an option. If it is unset, then the field may be freely used as an 742 * option on any kind of entity. Note: as of January 2023, support for this is 743 * in progress and does not yet have an effect (b/264593489). 744 */ 745 enum OptionTargetType { 746 TARGET_TYPE_UNKNOWN = 0; 747 748 TARGET_TYPE_FILE = 1; 749 750 TARGET_TYPE_EXTENSION_RANGE = 2; 751 752 TARGET_TYPE_MESSAGE = 3; 753 754 TARGET_TYPE_FIELD = 4; 755 756 TARGET_TYPE_ONEOF = 5; 757 758 TARGET_TYPE_ENUM = 6; 759 760 TARGET_TYPE_ENUM_ENTRY = 7; 761 762 TARGET_TYPE_SERVICE = 8; 763 764 TARGET_TYPE_METHOD = 9; 765 } 766 767 extensions 1000 to max; 768 769 reserved 4, 18; 770 } 771 772 /* Describes a complete .proto file. */ 773 message FileDescriptorProto { 774 optional string name = 1; /* file name, relative to root of source tree */ 775 776 optional string package = 2; /* e.g. "foo", "foo.bar", etc. */ 777 778 /* Names of files imported by this file. */ 779 repeated string dependency = 3; 780 781 /* All top-level definitions in this file. */ 782 repeated DescriptorProto message_type = 4; 783 784 repeated EnumDescriptorProto enum_type = 5; 785 786 repeated ServiceDescriptorProto service = 6; 787 788 repeated FieldDescriptorProto extension = 7; 789 790 optional FileOptions options = 8; 791 792 /* 793 * This field contains optional information about the original source code. 794 * You may safely remove this entire field without harming runtime 795 * functionality of the descriptors -- the information is needed only by 796 * development tools. 797 */ 798 optional SourceCodeInfo source_code_info = 9; 799 800 /* Indexes of the public imported files in the dependency list above. */ 801 repeated int32 public_dependency = 10; 802 803 /* 804 * Indexes of the weak imported files in the dependency list. 805 * For Google-internal migration only. Do not use. 806 */ 807 repeated int32 weak_dependency = 11; 808 809 /* 810 * The syntax of the proto file. 811 * The supported values are "proto2", "proto3", and "editions". 812 * 813 * If `edition` is present, this value must be "editions". 814 */ 815 optional string syntax = 12; 816 817 /* The edition of the proto file. */ 818 optional Edition edition = 14; 819 } 820 821 /* 822 * The protocol compiler can output a FileDescriptorSet containing the .proto 823 * files it parses. 824 */ 825 message FileDescriptorSet { 826 repeated FileDescriptorProto file = 1; 827 } 828 829 /* 830 * =================================================================== 831 * Options 832 */ 833 834 /* 835 * Each of the definitions above may have "options" attached. These are 836 * just annotations which may cause code to be generated slightly differently 837 * or may contain hints for code that manipulates protocol messages. 838 * 839 * Clients may define custom options as extensions of the *Options messages. 840 * These extensions may not yet be known at parsing time, so the parser cannot 841 * store the values in them. Instead it stores them in a field in the *Options 842 * message called uninterpreted_option. This field must have the same name 843 * across all *Options messages. We then use this field to populate the 844 * extensions when we build a descriptor, at which point all protos have been 845 * parsed and so all extensions are known. 846 * 847 * Extension numbers for custom options may be chosen as follows: 848 * * For options which will only be used within a single application or 849 * organization, or for experimental options, use field numbers 50000 850 * through 99999. It is up to you to ensure that you do not use the 851 * same number for multiple options. 852 * * For options which will be published and used publicly by multiple 853 * independent entities, e-mail protobuf-global-extension-registry@google.com 854 * to reserve extension numbers. Simply provide your project name (e.g. 855 * Objective-C plugin) and your project website (if available) -- there's no 856 * need to explain how you intend to use them. Usually you only need one 857 * extension number. You can declare multiple options with only one extension 858 * number by putting them in a sub-message. See the Custom Options section of 859 * the docs for examples: 860 * https://developers.google.com/protocol-buffers/docs/proto#options 861 * If this turns out to be popular, a web service will be set up 862 * to automatically assign option numbers. 863 */ 864 865 message FileOptions { 866 /* 867 * Sets the Java package where classes generated from this .proto will be 868 * placed. By default, the proto package is used, but this is often 869 * inappropriate because proto packages do not normally start with backwards 870 * domain names. 871 */ 872 optional string java_package = 1; 873 874 /* 875 * Controls the name of the wrapper Java class generated for the .proto file. 876 * That class will always contain the .proto file's getDescriptor() method as 877 * well as any top-level extensions defined in the .proto file. 878 * If java_multiple_files is disabled, then all the other classes from the 879 * .proto file will be nested inside the single wrapper outer class. 880 */ 881 optional string java_outer_classname = 8; 882 883 optional OptimizeMode optimize_for = 9 [default = SPEED]; 884 885 /* 886 * If enabled, then the Java code generator will generate a separate .java 887 * file for each top-level message, enum, and service defined in the .proto 888 * file. Thus, these types will *not* be nested inside the wrapper class 889 * named by java_outer_classname. However, the wrapper class will still be 890 * generated to contain the file's getDescriptor() method as well as any 891 * top-level extensions defined in the file. 892 */ 893 optional bool java_multiple_files = 10 [default = false]; 894 895 /* 896 * Sets the Go package where structs generated from this .proto will be 897 * placed. If omitted, the Go package will be derived from the following: 898 * - The basename of the package import path, if provided. 899 * - Otherwise, the package statement in the .proto file, if present. 900 * - Otherwise, the basename of the .proto file, without extension. 901 */ 902 optional string go_package = 11; 903 904 /* 905 * Should generic services be generated in each language? "Generic" services 906 * are not specific to any particular RPC system. They are generated by the 907 * main code generators in each language (without additional plugins). 908 * Generic services were the only kind of service generation supported by 909 * early versions of google.protobuf. 910 * 911 * Generic services are now considered deprecated in favor of using plugins 912 * that generate code specific to your particular RPC system. Therefore, 913 * these default to false. Old code which depends on generic services should 914 * explicitly set them to true. 915 */ 916 optional bool cc_generic_services = 16 [default = false]; 917 918 optional bool java_generic_services = 17 [default = false]; 919 920 optional bool py_generic_services = 18 [default = false]; 921 922 /* This option does nothing. */ 923 optional bool java_generate_equals_and_hash = 20 [deprecated = true]; 924 925 /* 926 * Is this file deprecated? 927 * Depending on the target platform, this can emit Deprecated annotations 928 * for everything in the file, or it will be completely ignored; in the very 929 * least, this is a formalization for deprecating files. 930 */ 931 optional bool deprecated = 23 [default = false]; 932 933 /* 934 * If set true, then the Java2 code generator will generate code that 935 * throws an exception whenever an attempt is made to assign a non-UTF-8 936 * byte sequence to a string field. 937 * Message reflection will do the same. 938 * However, an extension field still accepts non-UTF-8 byte sequences. 939 * This option has no effect on when used with the lite runtime. 940 */ 941 optional bool java_string_check_utf8 = 27 [default = false]; 942 943 /* 944 * Enables the use of arenas for the proto messages in this file. This applies 945 * only to generated classes for C++. 946 */ 947 optional bool cc_enable_arenas = 31 [default = true]; 948 949 /* 950 * Sets the objective c class prefix which is prepended to all objective c 951 * generated classes from this .proto. There is no default. 952 */ 953 optional string objc_class_prefix = 36; 954 955 /* Namespace for generated classes; defaults to the package. */ 956 optional string csharp_namespace = 37; 957 958 /* 959 * By default Swift generators will take the proto package and CamelCase it 960 * replacing '.' with underscore and use that to prefix the types/symbols 961 * defined. When this options is provided, they will use this value instead 962 * to prefix the types/symbols defined. 963 */ 964 optional string swift_prefix = 39; 965 966 /* 967 * Sets the php class prefix which is prepended to all php generated classes 968 * from this .proto. Default is empty. 969 */ 970 optional string php_class_prefix = 40; 971 972 /* 973 * Use this option to change the namespace of php generated classes. Default 974 * is empty. When this option is empty, the package name will be used for 975 * determining the namespace. 976 */ 977 optional string php_namespace = 41; 978 979 optional bool php_generic_services = 42 [default = false]; 980 981 /* 982 * Use this option to change the namespace of php generated metadata classes. 983 * Default is empty. When this option is empty, the proto file name will be 984 * used for determining the namespace. 985 */ 986 optional string php_metadata_namespace = 44; 987 988 /* 989 * Use this option to change the package of ruby generated classes. Default 990 * is empty. When this option is not set, the package name will be used for 991 * determining the ruby package. 992 */ 993 optional string ruby_package = 45; 994 995 /* Any features defined in the specific edition. */ 996 optional FeatureSet features = 50; 997 998 /* 999 * The parser stores options it doesn't recognize here. 1000 * See the documentation for the "Options" section above. 1001 */ 1002 repeated UninterpretedOption uninterpreted_option = 999; 1003 1004 /* Generated classes can be optimized for speed or code size. */ 1005 enum OptimizeMode { 1006 SPEED = 1; /* Generate complete code for parsing, serialization, */ 1007 1008 /* etc. */ 1009 CODE_SIZE = 2; /* Use ReflectionOps to implement these methods. */ 1010 1011 LITE_RUNTIME = 3; /* Generate code using MessageLite and the lite runtime. */ 1012 } 1013 1014 extensions 1000 to max; 1015 1016 reserved 38; 1017 } 1018 1019 /* 1020 * Describes the relationship between generated code and its original source 1021 * file. A GeneratedCodeInfo message is associated with only one generated 1022 * source file, but may contain references to different source .proto files. 1023 */ 1024 message GeneratedCodeInfo { 1025 /* 1026 * An Annotation connects some span of text in generated code to an element 1027 * of its generating .proto file. 1028 */ 1029 repeated Annotation annotation = 1; 1030 1031 message Annotation { 1032 /* 1033 * Identifies the element in the original source .proto file. This field 1034 * is formatted the same as SourceCodeInfo.Location.path. 1035 */ 1036 repeated int32 path = 1 [packed = true]; 1037 1038 /* Identifies the filesystem path to the original source .proto. */ 1039 optional string source_file = 2; 1040 1041 /* 1042 * Identifies the starting offset in bytes in the generated code 1043 * that relates to the identified object. 1044 */ 1045 optional int32 begin = 3; 1046 1047 /* 1048 * Identifies the ending offset in bytes in the generated code that 1049 * relates to the identified object. The end offset should be one past 1050 * the last relevant byte (so the length of the text = end - begin). 1051 */ 1052 optional int32 end = 4; 1053 1054 optional Semantic semantic = 5; 1055 1056 /* 1057 * Represents the identified object's effect on the element in the original 1058 * .proto file. 1059 */ 1060 enum Semantic { 1061 /* There is no effect or the effect is indescribable. */ 1062 NONE = 0; 1063 1064 /* The element is set or otherwise mutated. */ 1065 SET = 1; 1066 1067 /* An alias to the element is returned. */ 1068 ALIAS = 2; 1069 } 1070 } 1071 } 1072 1073 message MessageOptions { 1074 /* 1075 * Set true to use the old proto1 MessageSet wire format for extensions. 1076 * This is provided for backwards-compatibility with the MessageSet wire 1077 * format. You should not use this for any other reason: It's less 1078 * efficient, has fewer features, and is more complicated. 1079 * 1080 * The message must be defined exactly as follows: 1081 * message Foo { 1082 * option message_set_wire_format = true; 1083 * extensions 4 to max; 1084 * } 1085 * Note that the message cannot have any defined fields; MessageSets only 1086 * have extensions. 1087 * 1088 * All extensions of your type must be singular messages; e.g. they cannot 1089 * be int32s, enums, or repeated messages. 1090 * 1091 * Because this is an option, the above two restrictions are not enforced by 1092 * the protocol compiler. 1093 */ 1094 optional bool message_set_wire_format = 1 [default = false]; 1095 1096 /* 1097 * Disables the generation of the standard "descriptor()" accessor, which can 1098 * conflict with a field of the same name. This is meant to make migration 1099 * from proto1 easier; new code should avoid fields named "descriptor". 1100 */ 1101 optional bool no_standard_descriptor_accessor = 2 [default = false]; 1102 1103 /* 1104 * Is this message deprecated? 1105 * Depending on the target platform, this can emit Deprecated annotations 1106 * for the message, or it will be completely ignored; in the very least, 1107 * this is a formalization for deprecating messages. 1108 */ 1109 optional bool deprecated = 3 [default = false]; 1110 1111 /* 1112 * NOTE: Do not set the option in .proto files. Always use the maps syntax 1113 * instead. The option should only be implicitly set by the proto compiler 1114 * parser. 1115 * 1116 * Whether the message is an automatically generated map entry type for the 1117 * maps field. 1118 * 1119 * For maps fields: 1120 * map<KeyType, ValueType> map_field = 1; 1121 * The parsed descriptor looks like: 1122 * message MapFieldEntry { 1123 * option map_entry = true; 1124 * optional KeyType key = 1; 1125 * optional ValueType value = 2; 1126 * } 1127 * repeated MapFieldEntry map_field = 1; 1128 * 1129 * Implementations may choose not to generate the map_entry=true message, but 1130 * use a native map in the target language to hold the keys and values. 1131 * The reflection APIs in such implementations still need to work as 1132 * if the field is a repeated message field. 1133 */ 1134 optional bool map_entry = 7; 1135 1136 /* 1137 * Enable the legacy handling of JSON field name conflicts. This lowercases 1138 * and strips underscored from the fields before comparison in proto3 only. 1139 * The new behavior takes `json_name` into account and applies to proto2 as 1140 * well. 1141 * 1142 * This should only be used as a temporary measure against broken builds due 1143 * to the change in behavior for JSON field name conflicts. 1144 * 1145 * TODO This is legacy behavior we plan to remove once downstream 1146 * teams have had time to migrate. 1147 */ 1148 optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; 1149 1150 /* Any features defined in the specific edition. */ 1151 optional FeatureSet features = 12; 1152 1153 /* The parser stores options it doesn't recognize here. See above. */ 1154 repeated UninterpretedOption uninterpreted_option = 999; 1155 1156 extensions 1000 to max; 1157 1158 reserved 4, 5, 6, 8, 9; 1159 } 1160 1161 /* Describes a method of a service. */ 1162 message MethodDescriptorProto { 1163 optional string name = 1; 1164 1165 /* 1166 * Input and output type names. These are resolved in the same way as 1167 * FieldDescriptorProto.type_name, but must refer to a message type. 1168 */ 1169 optional string input_type = 2; 1170 1171 optional string output_type = 3; 1172 1173 optional MethodOptions options = 4; 1174 1175 /* Identifies if client streams multiple client messages */ 1176 optional bool client_streaming = 5 [default = false]; 1177 1178 /* Identifies if server streams multiple server messages */ 1179 optional bool server_streaming = 6 [default = false]; 1180 } 1181 1182 message MethodOptions { 1183 /* 1184 * Note: Field numbers 1 through 32 are reserved for Google's internal RPC 1185 * framework. We apologize for hoarding these numbers to ourselves, but 1186 * we were already using them long before we decided to release Protocol 1187 * Buffers. 1188 */ 1189 1190 /* 1191 * Is this method deprecated? 1192 * Depending on the target platform, this can emit Deprecated annotations 1193 * for the method, or it will be completely ignored; in the very least, 1194 * this is a formalization for deprecating methods. 1195 */ 1196 optional bool deprecated = 33 [default = false]; 1197 1198 optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; 1199 1200 /* Any features defined in the specific edition. */ 1201 optional FeatureSet features = 35; 1202 1203 /* The parser stores options it doesn't recognize here. See above. */ 1204 repeated UninterpretedOption uninterpreted_option = 999; 1205 1206 /* 1207 * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, 1208 * or neither? HTTP based RPC implementation may choose GET verb for safe 1209 * methods, and PUT verb for idempotent methods instead of the default POST. 1210 */ 1211 enum IdempotencyLevel { 1212 IDEMPOTENCY_UNKNOWN = 0; 1213 1214 NO_SIDE_EFFECTS = 1; /* implies idempotent */ 1215 1216 IDEMPOTENT = 2; /* idempotent, but may have side effects */ 1217 } 1218 1219 extensions 1000 to max; 1220 } 1221 1222 /* Describes a oneof. */ 1223 message OneofDescriptorProto { 1224 optional string name = 1; 1225 1226 optional OneofOptions options = 2; 1227 } 1228 1229 message OneofOptions { 1230 /* Any features defined in the specific edition. */ 1231 optional FeatureSet features = 1; 1232 1233 /* The parser stores options it doesn't recognize here. See above. */ 1234 repeated UninterpretedOption uninterpreted_option = 999; 1235 1236 extensions 1000 to max; 1237 } 1238 1239 /* Describes a service. */ 1240 message ServiceDescriptorProto { 1241 optional string name = 1; 1242 1243 repeated MethodDescriptorProto method = 2; 1244 1245 optional ServiceOptions options = 3; 1246 } 1247 1248 message ServiceOptions { 1249 /* 1250 * Note: Field numbers 1 through 32 are reserved for Google's internal RPC 1251 * framework. We apologize for hoarding these numbers to ourselves, but 1252 * we were already using them long before we decided to release Protocol 1253 * Buffers. 1254 */ 1255 1256 /* 1257 * Is this service deprecated? 1258 * Depending on the target platform, this can emit Deprecated annotations 1259 * for the service, or it will be completely ignored; in the very least, 1260 * this is a formalization for deprecating services. 1261 */ 1262 optional bool deprecated = 33 [default = false]; 1263 1264 /* Any features defined in the specific edition. */ 1265 optional FeatureSet features = 34; 1266 1267 /* The parser stores options it doesn't recognize here. See above. */ 1268 repeated UninterpretedOption uninterpreted_option = 999; 1269 1270 extensions 1000 to max; 1271 } 1272 1273 /* 1274 * =================================================================== 1275 * Optional source code info 1276 */ 1277 1278 /* 1279 * Encapsulates information about the original source file from which a 1280 * FileDescriptorProto was generated. 1281 */ 1282 message SourceCodeInfo { 1283 /* 1284 * A Location identifies a piece of source code in a .proto file which 1285 * corresponds to a particular definition. This information is intended 1286 * to be useful to IDEs, code indexers, documentation generators, and similar 1287 * tools. 1288 * 1289 * For example, say we have a file like: 1290 * message Foo { 1291 * optional string foo = 1; 1292 * } 1293 * Let's look at just the field definition: 1294 * optional string foo = 1; 1295 * ^ ^^ ^^ ^ ^^^ 1296 * a bc de f ghi 1297 * We have the following locations: 1298 * span path represents 1299 * [a,i) [ 4, 0, 2, 0 ] The whole field definition. 1300 * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). 1301 * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). 1302 * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). 1303 * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). 1304 * 1305 * Notes: 1306 * - A location may refer to a repeated field itself (i.e. not to any 1307 * particular index within it). This is used whenever a set of elements are 1308 * logically enclosed in a single code segment. For example, an entire 1309 * extend block (possibly containing multiple extension definitions) will 1310 * have an outer location whose path refers to the "extensions" repeated 1311 * field without an index. 1312 * - Multiple locations may have the same path. This happens when a single 1313 * logical declaration is spread out across multiple places. The most 1314 * obvious example is the "extend" block again -- there may be multiple 1315 * extend blocks in the same scope, each of which will have the same path. 1316 * - A location's span is not always a subset of its parent's span. For 1317 * example, the "extendee" of an extension declaration appears at the 1318 * beginning of the "extend" block and is shared by all extensions within 1319 * the block. 1320 * - Just because a location's span is a subset of some other location's span 1321 * does not mean that it is a descendant. For example, a "group" defines 1322 * both a type and a field in a single declaration. Thus, the locations 1323 * corresponding to the type and field and their components will overlap. 1324 * - Code which tries to interpret locations should probably be designed to 1325 * ignore those that it doesn't understand, as more types of locations could 1326 * be recorded in the future. 1327 */ 1328 repeated Location location = 1; 1329 1330 message Location { 1331 /* 1332 * Identifies which part of the FileDescriptorProto was defined at this 1333 * location. 1334 * 1335 * Each element is a field number or an index. They form a path from 1336 * the root FileDescriptorProto to the place where the definition occurs. 1337 * For example, this path: 1338 * [ 4, 3, 2, 7, 1 ] 1339 * refers to: 1340 * file.message_type(3) // 4, 3 1341 * .field(7) // 2, 7 1342 * .name() // 1 1343 * This is because FileDescriptorProto.message_type has field number 4: 1344 * repeated DescriptorProto message_type = 4; 1345 * and DescriptorProto.field has field number 2: 1346 * repeated FieldDescriptorProto field = 2; 1347 * and FieldDescriptorProto.name has field number 1: 1348 * optional string name = 1; 1349 * 1350 * Thus, the above path gives the location of a field name. If we removed 1351 * the last element: 1352 * [ 4, 3, 2, 7 ] 1353 * this path refers to the whole field declaration (from the beginning 1354 * of the label to the terminating semicolon). 1355 */ 1356 repeated int32 path = 1 [packed = true]; 1357 1358 /* 1359 * Always has exactly three or four elements: start line, start column, 1360 * end line (optional, otherwise assumed same as start line), end column. 1361 * These are packed into a single field for efficiency. Note that line 1362 * and column numbers are zero-based -- typically you will want to add 1363 * 1 to each before displaying to a user. 1364 */ 1365 repeated int32 span = 2 [packed = true]; 1366 1367 // If this SourceCodeInfo represents a complete declaration, these are any 1368 // comments appearing before and after the declaration which appear to be 1369 // attached to the declaration. 1370 // 1371 // A series of line comments appearing on consecutive lines, with no other 1372 // tokens appearing on those lines, will be treated as a single comment. 1373 // 1374 // leading_detached_comments will keep paragraphs of comments that appear 1375 // before (but not connected to) the current element. Each paragraph, 1376 // separated by empty lines, will be one comment element in the repeated 1377 // field. 1378 // 1379 // Only the comment content is provided; comment markers (e.g. //) are 1380 // stripped out. For block comments, leading whitespace and an asterisk 1381 // will be stripped from the beginning of each line other than the first. 1382 // Newlines are included in the output. 1383 // 1384 // Examples: 1385 // 1386 // optional int32 foo = 1; // Comment attached to foo. 1387 // // Comment attached to bar. 1388 // optional int32 bar = 2; 1389 // 1390 // optional string baz = 3; 1391 // // Comment attached to baz. 1392 // // Another line attached to baz. 1393 // 1394 // // Comment attached to moo. 1395 // // 1396 // // Another line attached to moo. 1397 // optional double moo = 4; 1398 // 1399 // // Detached comment for corge. This is not leading or trailing comments 1400 // // to moo or corge because there are blank lines separating it from 1401 // // both. 1402 // 1403 // // Detached comment for corge paragraph 2. 1404 // 1405 // optional string corge = 5; 1406 // /* Block comment attached 1407 // * to corge. Leading asterisks 1408 // * will be removed. */ 1409 // /* Block comment attached to 1410 // * grault. */ 1411 // optional int32 grault = 6; 1412 // 1413 // // ignored detached comments. 1414 optional string leading_comments = 3; 1415 1416 optional string trailing_comments = 4; 1417 1418 repeated string leading_detached_comments = 6; 1419 } 1420 } 1421 1422 /* 1423 * A message representing a option the parser does not recognize. This only 1424 * appears in options protos created by the compiler::Parser class. 1425 * DescriptorPool resolves these when building Descriptor objects. Therefore, 1426 * options protos in descriptor objects (e.g. returned by Descriptor::options(), 1427 * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions 1428 * in them. 1429 */ 1430 message UninterpretedOption { 1431 repeated NamePart name = 2; 1432 1433 /* 1434 * The value of the uninterpreted option, in whatever type the tokenizer 1435 * identified it as during parsing. Exactly one of these should be set. 1436 */ 1437 optional string identifier_value = 3; 1438 1439 optional uint64 positive_int_value = 4; 1440 1441 optional int64 negative_int_value = 5; 1442 1443 optional double double_value = 6; 1444 1445 optional bytes string_value = 7; 1446 1447 optional string aggregate_value = 8; 1448 1449 /* 1450 * The name of the uninterpreted option. Each string represents a segment in 1451 * a dot-separated name. is_extension is true iff a segment represents an 1452 * extension (denoted with parentheses in options specs in .proto files). 1453 * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents 1454 * "foo.(bar.baz).moo". 1455 */ 1456 message NamePart { 1457 required string name_part = 1; 1458 1459 required bool is_extension = 2; 1460 } 1461 } 1462 1463 /* The full set of known editions. */ 1464 enum Edition { 1465 /* A placeholder for an unknown edition value. */ 1466 EDITION_UNKNOWN = 0; 1467 1468 /* 1469 * Placeholder editions for testing feature resolution. These should not be 1470 * used or relyed on outside of tests. 1471 */ 1472 EDITION_1_TEST_ONLY = 1; 1473 1474 EDITION_2_TEST_ONLY = 2; 1475 1476 /* 1477 * Legacy syntax "editions". These pre-date editions, but behave much like 1478 * distinct editions. These can't be used to specify the edition of proto 1479 * files, but feature definitions must supply proto2/proto3 defaults for 1480 * backwards compatibility. 1481 */ 1482 EDITION_PROTO2 = 998; 1483 1484 EDITION_PROTO3 = 999; 1485 1486 /* 1487 * Editions that have been released. The specific values are arbitrary and 1488 * should not be depended on, but they will always be time-ordered for easy 1489 * comparison. 1490 */ 1491 EDITION_2023 = 1000; 1492 1493 EDITION_99997_TEST_ONLY = 99997; 1494 1495 EDITION_99998_TEST_ONLY = 99998; 1496 1497 EDITION_99999_TEST_ONLY = 99999; 1498 }