Here we list the minimum requirements that a repository must fulfill.
All CRUD implementations must implement:
The following verb implementations are optional, but if done, should behave as follows:
All implementations must use only the framework's tool to access the database.
Creating the tables, seeding data, queries etc. all must be as agnostic as possible.
Check this file for more information regarding the structure for the tables.
A list of some basic endpoints that must be implemented:
POST /login
GET /contacts
GET /contacts/:id
POST /contacts
PUT /contacts/:id
DELETE /contacts/:id
Question: must the sub-resource stay under its parent endpoint?
GET /contacts/:id/address
GET /contacts/:id/address/:addr_id
POST /contacts/:id/address
PUT /contacts/:id/address/:addr_id
DELETE /contacts/:id/address/:addr_id
All responses must be structured accordingly with the following pattern:
For 2XX return codes:
For a single entity: { data: {...} }
For multiple entities: { data: [{...}, ..., {...}] }
For 4XX and 5XX return codes:
{ error: { description: "...", ...} }