Support generic type parameter and return type
See original GitHub issueReturn type:
Current only support return Promise<XXX>
, when return Promise<Response<XXX>>
or Response<XXX>
, cli throw error “No matching model found for referenced type T”.
Paramter type: use generic type in parameter can generate definition file, but swagger show parameter’s schema is undefined.
Can you support it? thank you.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:19 (7 by maintainers)
Top Results From Across the Web
Using different generic types on a method's argument and ...
You need to explicitly specify the return generic type as a type parameter to the method. Something like:
Read more >Generic Methods - Java™ Tutorials
Generic methods allow type parameters to be used to express dependencies among the types of one or more arguments to a method and/or...
Read more >How To Use Generics in TypeScript
TypeScript fully supports generics as a way to introduce type-safety into components that accept arguments and return values whose type will ...
Read more >Documentation - Generics
A generic class has a similar shape to a generic interface. Generic classes have a generic type parameter list in angle brackets (...
Read more >4. Generics - Programming C# 8.0 [Book]
You can use a constructed generic type anywhere you would use a normal type. For example, you can use them as the types...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see that support for this was merged, but if I try to use
Promise<ResultList<Resource>>
I get an error:with
ResultList
beingversion:
tsoa@1.1.8
+1