Skip to content

spec.ExpandSpec doesn't seem to terminate in some swagger spec with recursive references #75

Closed
@elakito

Description

Hi,
I noticed this problem when generating a go client from one of the odata-openapi samples. The generation gets stuck and looking into this problem revealed that the call to spec.EpandSpec is not coming back. While looking at the recursive iterations that go into expandSchema in expander.go, I am wondering why we are not doing something like isSeen check in addition to isCircular check.

I put a test case that shows this issue at my forked repo.
https://github.com/elakito/spec/blob/issue-expand/expander_test.go#L454
and this is the swagger file used.
https://github.com/elakito/spec/blob/issue-expand/fixtures/expansion/circularSpec2.json

If someone can comment on this issue, that would be appreciated.

regards, aki

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions