There is a bug with relation parameter name in URLs #168
Labels
bug
Something isn't working
version-patch
It is just a patch for the current version. It is not a new feature, nor a breaking change.
Projects
Problem
PATCH /api/v1/customers/:id
PATCH /api/v1/customers/:parentId/employees/:id
DELETE /api/v1/customers/:parentId/employees/:id
POST /api/v1/customers/:parentId/employees/:parentId/children
We can't use
parentId
multiple times in URL. We can't find the correct parameter for the correct model.Expectation
PATCH /api/v1/customers/:id
PATCH /api/v1/customers/:customerId/employees/:id
DELETE /api/v1/customers/:customerId/employees/:id
POST /api/v1/customers/:customerId/employees/:employeeId/children
We should use the following pattern;
camelCase
Examples
User.id
->userId
User.uuid
->userUuid
UserTag.ud
->userTagId
Tech Details
relation.foreignKey
relationModel.name
+relationModel.primaryKey
userId
userTagUuid
Addition: We should check
request.params
usage in the whole library.The text was updated successfully, but these errors were encountered: