Don't use Minimal API incorrectly.
A few days ago, I reviewed a web application with a REST API developed by one team.
The web application was originally built with .NET 4.5 and has recently been ported to .NET 7. The REST API was created using Minimal API.
When I opened Program.cs, I was surprised to find that this file contained 86 endpoints. Many of these endpoints lacked cohesion.
If you have a Minimal API with numerous endpoints for multiple resources, it is essential to carefully evaluate the cohesion of these resources.
If the resources have low cohesion, it is advisable to group cohesive resources together and move their endpoints to appropriate API controllers.
This approach will help you achieve better code structure, not break Single Responsibility Principle
and facilitate the easy splitting of your API and application into a set of micro-services.