-
Notifications
You must be signed in to change notification settings - Fork 191
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
Support for inferred types #513
Comments
You need to implement an InferTypeParser and then parse into the right type for it. The easiest way is to create a small test program and then use the debugger to step through the execution and fix where things fail. |
Can you please give us some hints on how to implement InferTypeParser? I more or less understand how ts-json-schema-generator works, I have experiences with TypeScript AST, but I have no idea how to resolve inferted types. |
Take a look at what properties Then take for example https://github.com/vega/ts-json-schema-generator/blob/master/src/NodeParser/AnyTypeNodeParser.ts. It knows how to handle a particular type, and then generates the correct type (here I haven't thought more about how exactly to handle |
After reading this, I was quite sure that you’re from academia. And hey, you really are! 😄 So do I, sorta. |
Hello, fellow academic. I guess I should clarify that I mean "That's an exercise for the reader" somewhat sarcastically (because many books leave out too many steps when they use the phrase). There are actually a lot of steps left. |
🚀 Issue was released in |
Whenever trying to utilize inferred types, this error is thrown:
After searching, it appears that SyntaxKind #184 is indeed
InferType
. After looking through the source code it appears that there is not a node parser for inferred types. I'm not too familiar with the inner workings of the project, what kind of additions would be needed to support inferred types?The text was updated successfully, but these errors were encountered: