Feb 29, 2024
The proliferation of RESTful API endpoints results from blindly following ill-conceived, overly simplistic repository pattern examples, as your "retrieve user by their ID example illustrates.
Design more flexible CRUD endpoints that emulate the underlying power and flexibility of SQL like a parameterized GET endpoint that supports filtering, sorting, and pagination, and you'll never need more than one endpoint per entity/resource that can be invoked with POST, GET, PATCH, and DELETE HTTP verbs/operations.