typescript-json-schema icon indicating copy to clipboard operation
typescript-json-schema copied to clipboard

Recursion Results in "Maximum call stack size exceeded"

Open mwaeckerlin opened this issue 4 years ago • 1 comments

Even though there are many closed tickets regarding this problem, recursion still ends up in Maximum call stack size exceeded.

Simple to reproduce, create file recurse.tsx:

export type Recurse = {
    recurse: Recurse
}

Run:

$ npx typescript-json-validator recurse.tsx Recurse
Maximum call stack size exceeded
$ npx typescript-json-validator --version
2.4.2

mwaeckerlin avatar Jun 23 '21 10:06 mwaeckerlin

If you can, I would suggest using https://github.com/vega/ts-json-schema-generator since it handles recursion better.

domoritz avatar Jun 23 '21 17:06 domoritz