apisprout icon indicating copy to clipboard operation
apisprout copied to clipboard

Circular reference causes memory leak / crashes

Open AbhimanyuG opened this issue 6 years ago • 3 comments

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.

AbhimanyuG avatar Apr 06 '19 11:04 AbhimanyuG

Workarounds:

  • Keep distributed schemas in same directory.
  • Avoid circular references by using a shared schema file like common.yaml

AbhimanyuG avatar Apr 06 '19 12:04 AbhimanyuG

@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.

yaronius avatar Apr 25 '19 12:04 yaronius

Can you share a specific example? E.g. what is a small working OpenAPI file and web request I can make to reproduce this?

danielgtaylor avatar May 31 '19 05:05 danielgtaylor