openapi stack overflow when read protobuf struct
emicklei opened this issue · comments
Ernest Micklei commented
Ernest Micklei commented
i have difficulties finding a test that demonstrates the issue
@fanux can you change this example to your structure such that it fails?
func TestRecursiveFieldStructure(t *testing.T) {
type Foo struct{}
type Bar struct {
Foo `json:"foo"`
B struct {
Foo
f Foo
b *Bar
}
}
db := definitionBuilder{Definitions: spec.Definitions{}, Config: Config{}}
db.addModelFrom(Foo{})
t.Log(db)
}
fanux commented
type Foo struct{
b *Bar
}
type Bar struct {
Foo `json:"foo"`
B struct {
Foo
f Foo
b []*Bar
}
}
func TestRecursiveFieldStructure(t *testing.T) {
db := definitionBuilder{Definitions: spec.Definitions{}, Config: Config{}}
db.addModelFrom(Foo{})
t.Log(db)
}
This case will reproduce it.
Ernest Micklei commented
works on my machine :-(. , the v2 branch
Ernest Micklei commented
@fanux did you use the v2 branch?
fanux commented
Not yet, but I think if the test case passed, this issue can be closed