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: Unknown type "function" #560

Closed
treenwang opened this issue Nov 6, 2020 · 2 comments
Closed

Error: Unknown type "function" #560

treenwang opened this issue Nov 6, 2020 · 2 comments

Comments

@treenwang
Copy link

When parsing a typescript file like this:

 export type FunctionType = () => string 

or

export type FunctionType = {
    testFunction: () => string
};

An error will be throws:

Error: Unknown type "function"
    at ChainTypeFormatter.getTypeFormatter (/Users/treenwang/Work/product/graphql-service/node_modules/ts-json-schema-generator/dist/src/src/src/ChainTypeFormatter.ts:31:15)
    at ChainTypeFormatter.getChildren (/Users/treenwang/Work/product/graphql-service/node_modules/ts-json-schema-generator/dist/src/src/src/ChainTypeFormatter.ts:21:21)
@domoritz
Copy link
Member

domoritz commented Nov 6, 2020

Json schema has no support for functions. I'm happy to review a pull request that makes the parser just ignore them with a warning instead of crash.

@broofa
Copy link

broofa commented Apr 20, 2022

Breadcrumbs for people searching this error message:

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

3 participants