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
Is your feature request related to a problem? Please describe.
When using Any in unit tests for a proxy, I want to be able dynamically generate Protobuf definitions, load them using dynamicpb and compare them with protocmp. In this case, I read the FileDescriptorSet from storage rather than having them compiled in.
Describe the solution you'd like
There's already a TODO in handling Any suggesting support for a custom resolver. I think this is a good idea.
My proposal is to simply add a MessageTypeResolver(protoregistry.MessageTypeResolver) option to Transform. It requires creating a transformer struct, and making many of the (unexported) functions members of it. See tommie/protobuf-go@0a7aeae for a PoC.
Describe alternatives you've considered
Just having a "testing.proto" where I put all the various protos I need for testing. In my case, the FileDescriptorSet is generated together with other information, and requiring one path for production and one for testing is inconvenient.
The text was updated successfully, but these errors were encountered:
neild
changed the title
Support a custom Resolver in protocmp.Transform
protocmp: support custom Resolvers in TransformNov 4, 2021
Is your feature request related to a problem? Please describe.
When using
Any
in unit tests for a proxy, I want to be able dynamically generate Protobuf definitions, load them usingdynamicpb
and compare them withprotocmp
. In this case, I read theFileDescriptorSet
from storage rather than having them compiled in.Describe the solution you'd like
There's already a TODO in handling
Any
suggesting support for a custom resolver. I think this is a good idea.My proposal is to simply add a
MessageTypeResolver(protoregistry.MessageTypeResolver)
option toTransform
. It requires creating atransformer
struct, and making many of the (unexported) functions members of it. See tommie/protobuf-go@0a7aeae for a PoC.Describe alternatives you've considered
Just having a "testing.proto" where I put all the various protos I need for testing. In my case, the
FileDescriptorSet
is generated together with other information, and requiring one path for production and one for testing is inconvenient.The text was updated successfully, but these errors were encountered: