-
-
Notifications
You must be signed in to change notification settings - Fork 573
Open
Description
When defining a Goa service with gRPC, using the Any
type in the payload results in an error, even though Protobuf provides native support for Any
via the Well Known Types library
Example Code:
package v2
import (
. "goa.design/goa/v3/dsl"
)
var _ = Service("example", func() {
Description("An example service")
Method("hello", func() {
Description("Says hello")
Payload(func() {
Field(1, "object", Any, "Object to greet")
})
HTTP(func() {
GET("/hello")
})
GRPC(func() {
Response(CodeOK)
})
Result(String)
})
})
Error:
service "example" gRPC endpoint "hello": Attribute "object" is Any type which is not supported in gRPC
Expected Behavior:
Since Protobuf already supports the Any
type, Goa should ideally allow the use of Any
in gRPC payloads and map it to google.protobuf.Any
.
Question/Feature Request:
Can support for Protobuf Any
be added to Goa’s gRPC DSL so that attributes declared as Any
map to google.protobuf.Any
in the generated .proto
files?
Metadata
Metadata
Assignees
Labels
No labels