You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TS compiler in editor properly understands the computed type as:
typeExampleListUser=RepositoryFilterOptions<ListUser>;// Resulting type computation:{id?: string|string[];age?: number|number[];active?: boolean;}
Current Behavior
Currently, tsoa is understanding this type as if the T[P] extends string | number ? T[P] | T[P][] : T[P]; part of the utility type isn't there. It just infers the original type and uses that instead.
typeExampleListUser=RepositoryFilterOptions<ListUser>;// Simulation of tsoa type computation:{
id: string;
age: number;
active: boolean;}
Example spec output (incorrect based on above):
Version of the library: 4.1.3
Version of NodeJS: 16 LTS
Confirm you were using yarn not npm: [x]
The text was updated successfully, but these errors were encountered:
This is the final thing really stopping tsoa from being really great - type and generics resolution.
If your typing is any more then a level or two deep then you will only get the top level of the typing
It really prevents composability for generating request and response types from models and DTOs which kind of defeats the purpose of much of what tsoa offers.
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Consider a utility type and example model as follows:
The TS compiler in editor properly understands the computed type as:
Current Behavior
Currently,
tsoa
is understanding this type as if theT[P] extends string | number ? T[P] | T[P][] : T[P];
part of the utility type isn't there. It just infers the original type and uses that instead.Example spec output (incorrect based on above):
Version of the library: 4.1.3
Version of NodeJS: 16 LTS
The text was updated successfully, but these errors were encountered: