go-openapi / spec

openapi specification object model
Apache License 2.0
389 stars 98 forks source link

Stack overflow on parsing (large) OpenAPI 2.0 specification #69

Closed zxchris closed 6 years ago

zxchris commented 6 years ago

Hi, We've had a user of our OpenAPI documentation tool DapperDox report a Stack Overflow with our latest release. This was built today using master of go-openapi.

From the log, the stack overflow appears to be caused somewhere in go-openapi/spec/expander.go and we assume it may be caused by the size of the specification, as it is quite big, at 84K lines.

He has uploaded his specification and error log giving the stacktrace in a DapperDox issue: DapperDox Issue - Stack Overflow

To re-cook the binary releases, we have temporarily wound go-openapi/spec back to commit e51c28f07 and go-openapi/analysis back to 7427b3df9, which was stable for us previously.

Are you aware of issues with large specifications?

Cheers!

fredbi commented 6 years ago

PR#81 acknowledges there is no more issue parsing, expanding and unmarshalling the test case provided and that circular $ref are properly resolved.

I am not sure about the DapperBox issue itself.

Feel free to open another issue on this if you still face problems with this spec (from what I could gather, might be some other go-openapi module).