lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.54k stars 499 forks source link

[Discussion] Why is TS Compiler API not used? #1467

Closed jeengbe closed 1 year ago

jeengbe commented 1 year ago

Sorting

Issue

I assume tsoa uses an algorithm for determining a parameter's type that is inferior to the full TS Compiler suite. My assumption is based solely on the observation that tsoa is unable to work with certain types (e.g. some mapped types), which TS resolves perfectly fine.

What is the reason for this approach, instead of using the Compiler API for guaranteeing the same types that TS uses?


I have a controller with a set of complex mapped types that tsoa just gives up on (it crashes, actually), and I have a feeling this could be circumvented by using a standard implementation. Of course, I have no knowledge about the code base, so there might well be a reason.

github-actions[bot] commented 1 year ago

Hello there jeengbe 👋

Thank you for opening your very first issue in this project.

We will try to get back to you as soon as we can.👀

WoH commented 1 year ago

I am not sure what you mean, but we use the compiler API extensively. Whenever there is a mapping from TS to OpenAPI missing because it can't be parsed, that means no one was interested enough to add parsing of that relevant Node or it's type to OpenAPI

jeengbe commented 1 year ago

Whenever there is a mapping from TS to OpenAPI missing because it can't be parsed, that means no one was interested enough to add parsing of that relevant Node or it's type to OpenAPI

Ah, I see. Thanks. The way the errors are phrased made that unclear.