Skip to content
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

Error while rendering RecursivePartial type #1075

Closed
matteobruni opened this issue Dec 20, 2021 · 4 comments
Closed

Error while rendering RecursivePartial type #1075

matteobruni opened this issue Dec 20, 2021 · 4 comments

Comments

@matteobruni
Copy link

I migrated from typescript-json-schema because it wasn't working anymore. I set up everything to create a schema from an interface (too big to be pasted here, this is the link for reference).

But when I run the executable I got this error:

$ ts-json-schema-generator --path 'src/**/*.ts' --type 'IOptions' -f tsconfig.schema.json --additional-properties true --out ./schema/options.schema.json
Error: Unknown node "{" (ts.SyntaxKind = 188) at ***/tsparticles/engine/src/Types/RecursivePartial.ts(4,34)
error Command failed with exit code 1.

RecursivePartial.ts (can be seen in the link provided above)

/**
 * @category Types
 */
export type RecursivePartial<T> = {
    [P in keyof T]?: T[P] extends (infer U)[]
        ? RecursivePartial<U>[]
        : T[P] extends object | undefined
        ? RecursivePartial<T[P]>
        : T[P];
};
@domoritz
Copy link
Member

Can you go through the debugger and check what ts.SyntaxKind 188 is?

@matteobruni
Copy link
Author

I don’t know how to debug that, but I’ve searched the enum on the TypeScript source code, and it should be ConditionalType

@domoritz
Copy link
Member

The readme explains how to debug. The error usually means that we haven't implemented the appropriate node parser.

@domoritz
Copy link
Member

Done in #1265

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

No branches or pull requests

2 participants