routing-controllers icon indicating copy to clipboard operation
routing-controllers copied to clipboard

Can we pass generics as a class Type to @Body?

Open AbdulBari5 opened this issue 3 years ago • 1 comments

Hello, My senior is building a BaseController that implements the basic crud. While checking the request body we are passing a Class as a generic into BaseController in order to make it dynamic. Since the BaseController implements different controllers. Like RoleController, so RoleBodyData should be passed into BaseController as a generic for validation. But the problem is that @Body decorator doesn't respond to the generic. It is unable to get the Class somehow. We are stuck in the situation. Your help is much appreciated.

Best Regards, Abdul Bari

AbdulBari5 avatar Jul 28 '22 17:07 AbdulBari5

@AbdulBari5 could you provide an example repo?

attilaorosz avatar Jul 28 '22 17:07 attilaorosz

Closing this as stale.

If the issue still persists, you may open a new Q&A in the discussions tab and someone from the community may be able to help.

attilaorosz avatar Dec 21 '22 15:12 attilaorosz

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jan 21 '23 00:01 github-actions[bot]