We are developing a new REST Api for our Spring MVC legacy enterprise web application (before this it was communicationg with Adobe Flex frontends).
As a general rule we stated that we were creating a @RestController for every model we have in our application. We have also a BaseController for handling the CRUD operation on every model.
The fact is that the backend of our application is very large and monolithic, counting at least 2-3 thousands model classes, so creating a Controller for each of these its starting to look unrealistic.
On top of this we usa Swagger for API Documentation, so it also seems that for every controller we add, Swagger takes a little time at server startup to map the corresponsing endpoints. I fear this will escalate in very long server startup times (we use Tomcat).
Is it an antipattern to map a Controller for every model class?
Thanks