Regarding HTTP REST-style API design, I currently use two styles:
- Write separate GET/POST/PUT/DELETE endpoints for operations on each type of object, then add four corresponding endpoints for each new object type.
- Have unified GET/POST/PUT/DELETE endpoints for all objects. If objects are related, use glue code to wrap these four endpoints for customized functionality.
Both design approaches are close to extremes. The Type 1 API that I mainly work on has a terrifying amount of work - I have to make thousands of lines of changes for each new requirement. This is “terrifying” level workload for me, while the API implementation looks simple and non-technical to others, and the deadlines are extremely tight.
So I started looking for a middle ground between these two API approaches. (To be continued)