Repository navigation
v1.6.1
This release contains many bug fixes.
"github.com/jhump/protoreflect/desc"
Changes/fixes:
- If a field descriptor is missing a
json_nameattribute, instead of using the proto field name, the library now falls back to computing a default JSON name in the same manner asprotoc. This is necessary since descriptors that are generated into Java code byprotoc, for example, do not have the attribute present unless the option was explicitly present in the source.
"github.com/jhump/protoreflect/desc/builder"
Changes/fixes:
- Previously, messages with "message set wire encoding" were subject to the same tag limitations as other messages. However, message set wire encoding should be allowed to have a wider range of valid tags (all the way up to 2^31-2).
"github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- This package now produces descriptors that are deterministic. Previously, custom options that were represented as unrecognized fields were serialized in non-deterministic order.
- When using the new v1.4 protobuf runtime, descriptors produced by this package mistakenly omitted custom options. This is now corrected, and descriptors should now be complete when used with any protobuf runtime versions.
- Previously, messages with "message set wire encoding" were subject to the same tag limitations as other messages. However, message set wire encoding should be allowed to have a wider range of valid tags (all the way up to 2^31-2).
- Fixes numerous small issues in the parser, including some that caused its behavior to diverge from
protoc.- Options should support extensions of custom option messages, using syntax like so:
However,
option (custom.option).(some.extension) = "foo";protoparsewould fail with a syntax error upon seeing the second open parenthesis. This is now fixed. - Related to the "message set wire encoding" fix above, if a message with message set encoding had an extension range that referenced the keyword
max, the actual end tag encoded in the descriptor was wrong and did not represent the full allowed range for message set encoding. This is now fixed. - Numeric literals that had no floating point were not allowed to exceed the range of an int64. However, it should be possible to use larger values when providing values for uint64, float, and double types. This is now fixed.
- Groups can be used inside of a oneof (with
syntax = "proto2"). And groups can have options. Howeverprotoparserejected definitions of groups with options that were inside of a oneof. This is now fixed. - A oneof is valid if it has only groups (with
syntax = "proto2"). However,protoparsemistakenly rejected oneofs, stating they had to have at least one field. This is now fixed. - Validating
reservedstatements in messages and enums failed to identify duplicate reserved names in some cases. This is now fixed.
- Options should support extensions of custom option messages, using syntax like so:
"github.com/jhump/protoreflect/dynamic"
Changes/fixes:
- When using the new v1.4 protobuf runtime, converting between generated and dynamic messages would mistakenly drop unrecognized fields and extensions. This is now corrected, and messages should preserve these fields when converting to and from dynamic messages to generated types.