Allow missing extension ranges since not all messages are extended #497
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background & Problem
I'm working on a java grpc service that have a field of type
google.protobuf.DescriptorProto
from descriptor.proto in the response message.When running
grpcurl
, I'm hit with the following fatal error message:If I allow the grpcurl to continue past that error, I'm also getting errors on
google.protobuf.ExtensionRangeOptions
.For context, here's the snippet where FeatureSet is reserving extensions:
Difference in grpcurl and java-grpc
grpcurl
callsdesc.MessageDescriptor.GetExtensionRanges()
, which seems to return a list of the extension ranges above. However, java-grpc is callingFileDescriptor.getExtensions()
ref. From what I can tell,getExtensions()
is only returning a value if the message in question is extended by another message.For example, there are multiple other messages in
descriptor.proto
that also declare extension ranges in the same way, that are not failing. However, for those, there are other messages extending the message. See envoy/annotations/deprecation.proto:Solution?
So it seems like, for
fetchAllExtensions
to properly work, all messages with an extension range declared must have another message extending that message? That feels like a thing that should not necessarily always be true. Rather we would allow no extensions to be found on the message, since that is expected if there are only extension ranges declared (and no other messages extending it).Please advise if this solution makes sense, or if you think it's rather grpc-java that should update their reflection service to account for non-extended messages.
Thanks for a great tool!