goa icon indicating copy to clipboard operation
goa copied to clipboard

Infinite recursion when Type used in GRPC has an ArrayOf cyclic attribute

Open nitinmohan87 opened this issue 4 years ago • 0 comments

Generating code for the DSL below leads to infinite recursion in Goa. HTTP endpoints are not affected.

var CategoryResult = ResultType("application/vnd.category", func() {
  TypeName("CategoryResult")
  Attributes(func() {
    Field(1, "id", Int, "ID")
    Field(3, "children_category", ArrayOf("CategoryResult"))
    Field(4, "name", String, "name")
  })
})

// Service describes a service
var _ = Service("foo", func() {
  Method("bar", func() {
    Result(CategoryResult)
    GRPC(func() {})
  })
})

nitinmohan87 avatar Mar 23 '20 18:03 nitinmohan87