mikunn / openapi-schema-to-json-schema

Converts OpenAPI Schema Object to JSON Schema
75 stars 6 forks source link

Support for circular schemas #15

Open charisk opened 6 years ago

charisk commented 6 years ago

If the API spec contains a schema object that refers to itself, when converting it to a JSON schema, the following error occurs:

 TypeError: Converting circular structure to JSON
      at JSON.stringify (<anonymous>)
      at convert (node_modules\openapi-schema-to-json-schema\index.js:43:28)

This means that the tool cannot be used for any tree-type structures.

mikunn commented 6 years ago

Did you dereference all $refs before converting? If you did, can you provide a failing example?