Skip to content

aliasRefs creates a circular reference #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vogre opened this issue Dec 3, 2018 · 0 comments
Open

aliasRefs creates a circular reference #252

vogre opened this issue Dec 3, 2018 · 0 comments

Comments

@vogre
Copy link

vogre commented Dec 3, 2018

Example files: a.ts

export interface X {
  a: string;
}

export interface Y {
  x?: X;
}

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true
  }
}

Command line:
typescript-json-schema tsconfig.json "*" --required --ignoreErrors --refs --aliasRefs

Generates

"X": {
            "$ref": "#/definitions/X"
},

Possibly related to #246 as this will blow up the stack when used.

Possible workaround: specify as x: X | undefined instead of x?: X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant