Ability to ignore parsing proto Any field type.
What is the underlying problem you're trying to solve?
Today, I have services that act as a delievery pipeline for downstream services. We are looking to parse the outer part of a message. This type is well defined expect for the inner data which is a google.protobuf.Any. We do not wish to parse of act on this data as it's not defined when it comes to our service. We, also, don't have the definitions available ahead of time. This causes an error like "message": "proto: google.protobuf.Any: unable to resolve \"[type.googleapis.com/foo.bar.unknown.type](http://type.googleapis.com/foo.bar.unknown.type)\": not found".
It is happening because of protojson.Marshal(msg) in the request. This is expected behavior for the default use-case of protojson.
Describe the ideal solution
Envoy-opa should try to resolve google.protobuf.Any, If the type is unknown, the request shouldn't fail but continue forward. In the case, when a field is unknown and was unable to parse we could return "@error" field along with the original values something similar to https://github.com/fullstorydev/grpcurl/issues/193#issuecomment-714892842. If we don't care for any types ahead of time, we should be able to ignore the field completely.
Describe a "Good Enough" solution
Add an option that lets users tell envoy-opa to ignore any fields.
Additional Context
You can setup Options for marshalling and redefine the Resolvers that would ignore any type cases.
// messages. If nil, this defaults to using protoregistry.GlobalTypes.
Resolver interface {
protoregistry.ExtensionTypeResolver
protoregistry.MessageTypeResolver
}```