-
-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Is your feature request related to a problem? Please describe.
The REST routes generated are pretty unusual and closer to RPC than REST as the verbs are present in the path instead of the resources. /findMany
, /findUnique
, /create
, etc. are not standard in REST.
Describe the solution you'd like
I'd love more standard REST routes based on collections of resources:
GET /model/findMany
-> GET /models
GET /model/findUnique
-> GET /models/:id
POST /model/create
-> POST /models
PUT /model/update
-> PUT /models/:id
and PATCH /models/:id
DELETE /model/delete
-> DELETE /models/:id`
This also requires defining a collection name (models
) from a resource (or model) name (model
). That could be an attribute of the model so that it can be configured by the developer.
To make it even more standard, it'd be great to adopt https://jsonapi.org/ for the structure of the HTTP requests and responses.