#Generic controller with documentation in swagger
6 messages · Page 1 of 1 (latest)
When typescript supports reflecting metadata from generics (so, probably, not anytime soon)
nice, thank you so much
I just recently dipped into a not so old Java project with 4 levels of inheritance just for controllers. The lowest one defined all crud methods with swagger annotations. If you wanted to disable for example "delete", you had to override it in child controller and throw and error instead. I'll take non-generic explicit controller over inheritance hell any time 😅
I understand, but my project has a lot of controller files! I need to create all the methods to represent my CRUD, so it gets complicated!
I prefer to keep it like this and override the controller to disable the method, for example!
Thanks for sharing this situation with me!
If you insist on that approach, there is a way to do it using a class mixin approacch