apisprout
apisprout copied to clipboard
Circular reference causes memory leak / crashes
Take this scenario
file1.yaml
field:
$ref: './file2.yaml#/components/schemas/Something'
file2.yaml
AnotherThing:
$ref: './file1.yaml#/components/schemas/SomethingElse'
Currently apisprout will spike in memory usage or crash in such a scenario, even though references are resolvable.
Workarounds:
- Keep distributed schemas in same directory.
- Avoid circular references by using a shared schema file like common.yaml
@AbhimanyuG Thanks for sharing workarounds. Are you sure this is an APISprout issue? This tool uses https://github.com/getkin/kin-openapi internally for parsing and validating those YAML files. Also, it would be very helpful to see some crash reports/stack traces that you experienced.
Can you share a specific example? E.g. what is a small working OpenAPI file and web request I can make to reproduce this?