Consistency is key for API usage -- if users get a certain result out of one endpoint, they'll likely expect similar results from other endpoints. We should enforce standardization early in our design to improve the user experience.
Requirements
GET requests should include all optional parameters as query parameters within the url. Required non-sensitive parameters (such as the id) should be in the URL path. No parameters should be included in the JSON body (which is typically not included in GET requests
All mass GET requests should include a page identifier in the request URL. The number of entries per page should be 100.
POST requests should include all parameters as parameters in the JSON body.
PUT requests should include the id of the entity being updated in the url, and all new parameters for the entity in question in the JSON body
DELETE requests should include the id of the entity being update in the url. Nothing else should be included.
Potentially add object serialization as with marshmallow to better enforce types.
Tests
Set up standardized testing functions to confirm that results conform to these expected parameters.
Docs
As entities are standardized, documentation will need updated.
Open questions
Some endpoints may undergo breaking changes as a result of this.
Context
Requirements
GET
requests should include all optional parameters as query parameters within the url. Required non-sensitive parameters (such as the id) should be in the URL path. No parameters should be included in the JSON body (which is typically not included inGET
requestsGET
requests should include a page identifier in the request URL. The number of entries per page should be 100.POST
requests should include all parameters as parameters in the JSON body.PUT
requests should include the id of the entity being updated in the url, and all new parameters for the entity in question in the JSON bodyDELETE
requests should include the id of the entity being update in the url. Nothing else should be included.Tests
Docs
Open questions