4040syntax = "proto2" ;
4141
4242package google.protobuf ;
43+
4344option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor" ;
4445option java_package = "com.google.protobuf" ;
4546option java_outer_classname = "DescriptorProtos" ;
@@ -59,8 +60,8 @@ message FileDescriptorSet {
5960
6061// Describes a complete .proto file.
6162message FileDescriptorProto {
62- optional string name = 1 ; // file name, relative to root of source tree
63- optional string package = 2 ; // e.g. "foo", "foo.bar", etc.
63+ optional string name = 1 ; // file name, relative to root of source tree
64+ optional string package = 2 ; // e.g. "foo", "foo.bar", etc.
6465
6566 // Names of files imported by this file.
6667 repeated string dependency = 3 ;
@@ -100,8 +101,8 @@ message DescriptorProto {
100101 repeated EnumDescriptorProto enum_type = 4 ;
101102
102103 message ExtensionRange {
103- optional int32 start = 1 ;
104- optional int32 end = 2 ;
104+ optional int32 start = 1 ; // Inclusive.
105+ optional int32 end = 2 ; // Exclusive.
105106
106107 optional ExtensionRangeOptions options = 3 ;
107108 }
@@ -115,8 +116,8 @@ message DescriptorProto {
115116 // fields or extension ranges in the same message. Reserved ranges may
116117 // not overlap.
117118 message ReservedRange {
118- optional int32 start = 1 ; // Inclusive.
119- optional int32 end = 2 ; // Exclusive.
119+ optional int32 start = 1 ; // Inclusive.
120+ optional int32 end = 2 ; // Exclusive.
120121 }
121122 repeated ReservedRange reserved_range = 9 ;
122123 // Reserved field names, which may not be used by fields in the same message.
@@ -137,42 +138,42 @@ message FieldDescriptorProto {
137138 enum Type {
138139 // 0 is reserved for errors.
139140 // Order is weird for historical reasons.
140- TYPE_DOUBLE = 1 ;
141- TYPE_FLOAT = 2 ;
141+ TYPE_DOUBLE = 1 ;
142+ TYPE_FLOAT = 2 ;
142143 // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
143144 // negative values are likely.
144- TYPE_INT64 = 3 ;
145- TYPE_UINT64 = 4 ;
145+ TYPE_INT64 = 3 ;
146+ TYPE_UINT64 = 4 ;
146147 // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
147148 // negative values are likely.
148- TYPE_INT32 = 5 ;
149- TYPE_FIXED64 = 6 ;
150- TYPE_FIXED32 = 7 ;
151- TYPE_BOOL = 8 ;
152- TYPE_STRING = 9 ;
149+ TYPE_INT32 = 5 ;
150+ TYPE_FIXED64 = 6 ;
151+ TYPE_FIXED32 = 7 ;
152+ TYPE_BOOL = 8 ;
153+ TYPE_STRING = 9 ;
153154 // Tag-delimited aggregate.
154155 // Group type is deprecated and not supported in proto3. However, Proto3
155156 // implementations should still be able to parse the group wire format and
156157 // treat group fields as unknown fields.
157- TYPE_GROUP = 10 ;
158- TYPE_MESSAGE = 11 ; // Length-delimited aggregate.
158+ TYPE_GROUP = 10 ;
159+ TYPE_MESSAGE = 11 ; // Length-delimited aggregate.
159160
160161 // New in version 2.
161- TYPE_BYTES = 12 ;
162- TYPE_UINT32 = 13 ;
163- TYPE_ENUM = 14 ;
164- TYPE_SFIXED32 = 15 ;
165- TYPE_SFIXED64 = 16 ;
166- TYPE_SINT32 = 17 ; // Uses ZigZag encoding.
167- TYPE_SINT64 = 18 ; // Uses ZigZag encoding.
168- };
162+ TYPE_BYTES = 12 ;
163+ TYPE_UINT32 = 13 ;
164+ TYPE_ENUM = 14 ;
165+ TYPE_SFIXED32 = 15 ;
166+ TYPE_SFIXED64 = 16 ;
167+ TYPE_SINT32 = 17 ; // Uses ZigZag encoding.
168+ TYPE_SINT64 = 18 ; // Uses ZigZag encoding.
169+ }
169170
170171 enum Label {
171172 // 0 is reserved for errors
172- LABEL_OPTIONAL = 1 ;
173- LABEL_REQUIRED = 2 ;
174- LABEL_REPEATED = 3 ;
175- };
173+ LABEL_OPTIONAL = 1 ;
174+ LABEL_REQUIRED = 2 ;
175+ LABEL_REPEATED = 3 ;
176+ }
176177
177178 optional string name = 1 ;
178179 optional int32 number = 3 ;
@@ -234,8 +235,8 @@ message EnumDescriptorProto {
234235 // is inclusive such that it can appropriately represent the entire int32
235236 // domain.
236237 message EnumReservedRange {
237- optional int32 start = 1 ; // Inclusive.
238- optional int32 end = 2 ; // Inclusive.
238+ optional int32 start = 1 ; // Inclusive.
239+ optional int32 end = 2 ; // Inclusive.
239240 }
240241
241242 // Range of reserved numeric values. Reserved numeric values may not be used
@@ -276,9 +277,9 @@ message MethodDescriptorProto {
276277 optional MethodOptions options = 4 ;
277278
278279 // Identifies if client streams multiple client messages
279- optional bool client_streaming = 5 [default = false ];
280+ optional bool client_streaming = 5 [default = false ];
280281 // Identifies if server streams multiple server messages
281- optional bool server_streaming = 6 [default = false ];
282+ optional bool server_streaming = 6 [default = false ];
282283}
283284
284285
@@ -314,7 +315,6 @@ message MethodDescriptorProto {
314315// If this turns out to be popular, a web service will be set up
315316// to automatically assign option numbers.
316317
317-
318318message FileOptions {
319319
320320 // Sets the Java package where classes generated from this .proto will be
@@ -337,7 +337,7 @@ message FileOptions {
337337 // named by java_outer_classname. However, the outer class will still be
338338 // generated to contain the file's getDescriptor() method as well as any
339339 // top-level extensions defined in the file.
340- optional bool java_multiple_files = 10 [default = false ];
340+ optional bool java_multiple_files = 10 [default = false ];
341341
342342 // This option does nothing.
343343 optional bool java_generate_equals_and_hash = 20 [deprecated =true ];
@@ -348,17 +348,17 @@ message FileOptions {
348348 // Message reflection will do the same.
349349 // However, an extension field still accepts non-UTF-8 byte sequences.
350350 // This option has no effect on when used with the lite runtime.
351- optional bool java_string_check_utf8 = 27 [default = false ];
351+ optional bool java_string_check_utf8 = 27 [default = false ];
352352
353353
354354 // Generated classes can be optimized for speed or code size.
355355 enum OptimizeMode {
356- SPEED = 1 ; // Generate complete code for parsing, serialization,
357- // etc.
358- CODE_SIZE = 2 ; // Use ReflectionOps to implement these methods.
359- LITE_RUNTIME = 3 ; // Generate code using MessageLite and the lite runtime.
356+ SPEED = 1 ; // Generate complete code for parsing, serialization,
357+ // etc.
358+ CODE_SIZE = 2 ; // Use ReflectionOps to implement these methods.
359+ LITE_RUNTIME = 3 ; // Generate code using MessageLite and the lite runtime.
360360 }
361- optional OptimizeMode optimize_for = 9 [default = SPEED ];
361+ optional OptimizeMode optimize_for = 9 [default = SPEED ];
362362
363363 // Sets the Go package where structs generated from this .proto will be
364364 // placed. If omitted, the Go package will be derived from the following:
@@ -369,6 +369,7 @@ message FileOptions {
369369
370370
371371
372+
372373 // Should generic services be generated in each language? "Generic" services
373374 // are not specific to any particular RPC system. They are generated by the
374375 // main code generators in each language (without additional plugins).
@@ -379,20 +380,20 @@ message FileOptions {
379380 // that generate code specific to your particular RPC system. Therefore,
380381 // these default to false. Old code which depends on generic services should
381382 // explicitly set them to true.
382- optional bool cc_generic_services = 16 [default = false ];
383- optional bool java_generic_services = 17 [default = false ];
384- optional bool py_generic_services = 18 [default = false ];
385- optional bool php_generic_services = 42 [default = false ];
383+ optional bool cc_generic_services = 16 [default = false ];
384+ optional bool java_generic_services = 17 [default = false ];
385+ optional bool py_generic_services = 18 [default = false ];
386+ optional bool php_generic_services = 42 [default = false ];
386387
387388 // Is this file deprecated?
388389 // Depending on the target platform, this can emit Deprecated annotations
389390 // for everything in the file, or it will be completely ignored; in the very
390391 // least, this is a formalization for deprecating files.
391- optional bool deprecated = 23 [default = false ];
392+ optional bool deprecated = 23 [default = false ];
392393
393394 // Enables the use of arenas for the proto messages in this file. This applies
394395 // only to generated classes for C++.
395- optional bool cc_enable_arenas = 31 [default = false ];
396+ optional bool cc_enable_arenas = 31 [default = false ];
396397
397398
398399 // Sets the objective c class prefix which is prepended to all objective c
@@ -418,15 +419,16 @@ message FileOptions {
418419 optional string php_namespace = 41 ;
419420
420421 // Use this option to change the namespace of php generated metadata classes.
421- // Default is empty. When this option is empty, the proto file name will be used
422- // for determining the namespace.
422+ // Default is empty. When this option is empty, the proto file name will be
423+ // used for determining the namespace.
423424 optional string php_metadata_namespace = 44 ;
424425
425426 // Use this option to change the package of ruby generated classes. Default
426427 // is empty. When this option is not set, the package name will be used for
427428 // determining the ruby package.
428429 optional string ruby_package = 45 ;
429430
431+
430432 // The parser stores options it doesn't recognize here.
431433 // See the documentation for the "Options" section above.
432434 repeated UninterpretedOption uninterpreted_option = 999 ;
@@ -457,18 +459,18 @@ message MessageOptions {
457459 //
458460 // Because this is an option, the above two restrictions are not enforced by
459461 // the protocol compiler.
460- optional bool message_set_wire_format = 1 [default = false ];
462+ optional bool message_set_wire_format = 1 [default = false ];
461463
462464 // Disables the generation of the standard "descriptor()" accessor, which can
463465 // conflict with a field of the same name. This is meant to make migration
464466 // from proto1 easier; new code should avoid fields named "descriptor".
465- optional bool no_standard_descriptor_accessor = 2 [default = false ];
467+ optional bool no_standard_descriptor_accessor = 2 [default = false ];
466468
467469 // Is this message deprecated?
468470 // Depending on the target platform, this can emit Deprecated annotations
469471 // for the message, or it will be completely ignored; in the very least,
470472 // this is a formalization for deprecating messages.
471- optional bool deprecated = 3 [default = false ];
473+ optional bool deprecated = 3 [default = false ];
472474
473475 // Whether the message is an automatically generated map entry type for the
474476 // maps field.
@@ -496,6 +498,7 @@ message MessageOptions {
496498 reserved 8 ; // javalite_serializable
497499 reserved 9 ; // javanano_as_lite
498500
501+
499502 // The parser stores options it doesn't recognize here. See above.
500503 repeated UninterpretedOption uninterpreted_option = 999 ;
501504
@@ -575,16 +578,16 @@ message FieldOptions {
575578 // implementation must either *always* check its required fields, or *never*
576579 // check its required fields, regardless of whether or not the message has
577580 // been parsed.
578- optional bool lazy = 5 [default = false ];
581+ optional bool lazy = 5 [default = false ];
579582
580583 // Is this field deprecated?
581584 // Depending on the target platform, this can emit Deprecated annotations
582585 // for accessors, or it will be completely ignored; in the very least, this
583586 // is a formalization for deprecating fields.
584- optional bool deprecated = 3 [default = false ];
587+ optional bool deprecated = 3 [default = false ];
585588
586589 // For Google-internal migration only. Do not use.
587- optional bool weak = 10 [default = false ];
590+ optional bool weak = 10 [default = false ];
588591
589592
590593 // The parser stores options it doesn't recognize here. See above.
@@ -614,7 +617,7 @@ message EnumOptions {
614617 // Depending on the target platform, this can emit Deprecated annotations
615618 // for the enum, or it will be completely ignored; in the very least, this
616619 // is a formalization for deprecating enums.
617- optional bool deprecated = 3 [default = false ];
620+ optional bool deprecated = 3 [default = false ];
618621
619622 reserved 5 ; // javanano_as_lite
620623
@@ -630,7 +633,7 @@ message EnumValueOptions {
630633 // Depending on the target platform, this can emit Deprecated annotations
631634 // for the enum value, or it will be completely ignored; in the very least,
632635 // this is a formalization for deprecating enum values.
633- optional bool deprecated = 1 [default = false ];
636+ optional bool deprecated = 1 [default = false ];
634637
635638 // The parser stores options it doesn't recognize here. See above.
636639 repeated UninterpretedOption uninterpreted_option = 999 ;
@@ -650,7 +653,7 @@ message ServiceOptions {
650653 // Depending on the target platform, this can emit Deprecated annotations
651654 // for the service, or it will be completely ignored; in the very least,
652655 // this is a formalization for deprecating services.
653- optional bool deprecated = 33 [default = false ];
656+ optional bool deprecated = 33 [default = false ];
654657
655658 // The parser stores options it doesn't recognize here. See above.
656659 repeated UninterpretedOption uninterpreted_option = 999 ;
@@ -670,18 +673,18 @@ message MethodOptions {
670673 // Depending on the target platform, this can emit Deprecated annotations
671674 // for the method, or it will be completely ignored; in the very least,
672675 // this is a formalization for deprecating methods.
673- optional bool deprecated = 33 [default = false ];
676+ optional bool deprecated = 33 [default = false ];
674677
675678 // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
676679 // or neither? HTTP based RPC implementation may choose GET verb for safe
677680 // methods, and PUT verb for idempotent methods instead of the default POST.
678681 enum IdempotencyLevel {
679682 IDEMPOTENCY_UNKNOWN = 0 ;
680- NO_SIDE_EFFECTS = 1 ; // implies idempotent
681- IDEMPOTENT = 2 ; // idempotent, but may have side effects
683+ NO_SIDE_EFFECTS = 1 ; // implies idempotent
684+ IDEMPOTENT = 2 ; // idempotent, but may have side effects
682685 }
683- optional IdempotencyLevel idempotency_level =
684- 34 [default= IDEMPOTENCY_UNKNOWN];
686+ optional IdempotencyLevel idempotency_level = 34
687+ [default = IDEMPOTENCY_UNKNOWN ];
685688
686689 // The parser stores options it doesn't recognize here. See above.
687690 repeated UninterpretedOption uninterpreted_option = 999 ;
@@ -793,14 +796,14 @@ message SourceCodeInfo {
793796 // [ 4, 3, 2, 7 ]
794797 // this path refers to the whole field declaration (from the beginning
795798 // of the label to the terminating semicolon).
796- repeated int32 path = 1 [packed = true ];
799+ repeated int32 path = 1 [packed = true ];
797800
798801 // Always has exactly three or four elements: start line, start column,
799802 // end line (optional, otherwise assumed same as start line), end column.
800803 // These are packed into a single field for efficiency. Note that line
801804 // and column numbers are zero-based -- typically you will want to add
802805 // 1 to each before displaying to a user.
803- repeated int32 span = 2 [packed = true ];
806+ repeated int32 span = 2 [packed = true ];
804807
805808 // If this SourceCodeInfo represents a complete declaration, these are any
806809 // comments appearing before and after the declaration which appear to be
@@ -865,7 +868,7 @@ message GeneratedCodeInfo {
865868 message Annotation {
866869 // Identifies the element in the original source .proto file. This field
867870 // is formatted the same as SourceCodeInfo.Location.path.
868- repeated int32 path = 1 [packed = true ];
871+ repeated int32 path = 1 [packed = true ];
869872
870873 // Identifies the filesystem path to the original source .proto.
871874 optional string source_file = 2 ;
0 commit comments