Processing large OpenAPI spec leads to StackOverflow
While processing this Spec file (4k lines) - it seems that a recrusive function is causing an StackOverflow.
Command used: npx openapi-typescript-codegen --input ./adh-openapi-docs.json --output ./schemas
Error:
RangeError: Maximum call stack size exceeded
at String.replace (
9f31efb/node_modules/openapi-typescript-codegen/dist/index.js:1:20614
at K (/Users/khalednabli/.npm/_npx/47c45e4589f31efb/node_modules/openapi-typescript-codegen/dist/index.js:1:20810)
at ee (/Users/khalednabli/.npm/_npx/47c45e4589f31efb/node_modules/openapi-typescript-codegen/dist/index.js:1:24547)
at /Users/khalednabli/.npm/_npx/47c45e4589f31efb/node_modules/openapi-typescript-codegen/dist/index.js:1:20671
at Array.reduce (
@khanab85 It seems there is indeed a circular reference in the models. I quickly looked into this, but there seems to be something interesting with the composition of the models. Did you run this through other generators with succes? I will keep the ticket open as a reminder, but will need to check how to solve this.