You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rauanmayemir, the only way a descriptor resolver might be used is for CEL expressions that operate on google.protobuf.Any messages. Is that the issue you are encountering? If not, please describe the issue you are encountering with dynamic schemas, in case you're running into something else (like a bug).
@jhump No, there was no issue. Apparently, I didn't even have to add my regular message descriptors because the input message already has a ProtoReflect() with all the information, is that correct?
That's correct. A descriptor resolver is generally unnecessary since the message being validated knows its own descriptor (and all fields therein know their message types, too).
The only time you would run into trouble is when using google.protobuf.Any messages, where the contained message payload is a dynamic message (i.e. not known to the program via protoregistry.GlobalFiles). In this case, there are some operations in CEL expressions that will try to unpack the Any message, which would fail in this case. This is the only case where you would benefit from an option like this, to provide additional dynamic message types to the CEL interpreter so it knows how to unpack them.
Feature description:
Similar to
WithExtensionTypeResolver
, it would be helpful to allow adding your ownWithDescriptorResolver
option.Problem it solves or use case:
It will allow using dynamic schema registries outside of global
protoregistry.Files
Proposed implementation or solution:
Something like:
The text was updated successfully, but these errors were encountered: