well-typed / grapesy

Native Haskell gRPC client and server based on `http2`
Other
31 stars 4 forks source link

Support Protobuf `Any` type #146

Open edsko opened 1 month ago

edsko commented 1 month ago

See https://protobuf.dev/programming-guides/proto3/#any . Note that the status of Any is reported here as "Currently the runtime libraries for working with Any types are under development".

Supporting this is a bit awkward; following the spec exactly

import "google/protobuf/any.proto";

message ExampleMessage {
  google.protobuf.Any exampleField = 1;
}

currently results in Haskell code that imports

import qualified Proto.Google.Protobuf.Any

where that Proto. prefix depends on the location of the .proto definition using Any, as well as the precise way that protoc was invoked. Proper support for Any will probably require patching proto-lens-protoc (and possibly even requiring explicit support from protoc?).