Skip to content

v1.16.0

Latest
Compare
Choose a tag to compare
@jhump jhump released this 09 Apr 20:50
· 2 commits to main since this release
48670ae

This release adds support for Protobuf Editions to many of the packages. Note, however, that the desc/protoparse package does not yet work to parse Protobuf Editions source files. This release also includes a handful of bug-fixes.

"github.com/jhump/protoreflect/desc"

Additions:

  • Adds an Edition method to *desc.FileDescriptor, which returns non-zero for files that use Protobuf Editions (instead of syntax "proto2" or "proto3").

Changes/fixes:

  • Fixes an issue in the various Wrap* functions, that could result in a descriptor hierarchy where the same descriptors were incorrectly present multiple times. This could happen if a file in the transitive dependency graph being wrapped had more than one incoming edge (e.g. same file appearing in import statements from two or more other files).

"github.com/jhump/protoreflect/desc/builder"

Additions:

  • Adds an Editions field and SetEditions method to *builder.FileBuilder, for creating files that use Protobuf Editions.

"github.com/jhump/protoreflect/desc/protoprint"

Changes/fixes:

  • Now correctly prints the contents for files that use Protobuf Editions. Previously, if given a descriptor for a file used Protobuf Editions, it could generate invalid source output.
  • Fixed a bug when Printer.CustomSortFunction was set wherein enum values could be printed in incorrect order, resulting in invalid source output. In syntax "proto3" and in open enums in Protobuf Editions, the first value must be the one with a zero numeric value.

"github.com/jhump/protoreflect/grpcreflect"

Additions:

  • Adds a new AllowMissingFileDescriptors method to *grpcreflect.Client that allows users to opt-in to a lenient mode that will try to return schemas even when some files are unavailable. This will only be successful in cases where the missing files only provide custom options or are unused imports. This restores some lenience that was inadvertently provided (due to bugs and missing validation checks) when versions of this repo prior to v1.15 were combined with versions of the google.golang.org/grpc module prior to v1.61.