readmeio / api

🚀 Automatic SDK generation from an OpenAPI definition
https://api.readme.dev
MIT License
589 stars 26 forks source link

crashes with circular references #313

Closed lselden closed 3 years ago

lselden commented 3 years ago

I'm trying to load an OpenAPI 3.0 doc where there are circular references to components (i.e. comment has child array of comment objects). It's crashing with "TypeError: Converting circular structure to JSON".

relevant code: https://github.com/readmeio/api/blob/main/packages/api/src/cache.js#L152

I don't know your code, but maybe you need to bundle instead of dereference?

erunion commented 3 years ago

Are you comfortable sharing the OpenAPI definition that's causing this?

josei commented 3 years ago

@codat/v1.1.0#1mld74kq6wk0s1 crashes because of circular structures

erunion commented 3 years ago

I just pushed up v3.4.2 to npm which will fix your issue @josei. It should also fix yours @lselden but let me know if it doesn't.