Closed dalssoft closed 1 year ago
What exactly does the resourceName field refer to?
What exactly does the resourceName field refer to?
The resource to be used: GET /{resourceName}/
-> GET /user/
What exactly does the resourceName field refer to?
The resource to be used:
GET /{resourceName}/
->GET /user/
Would that make group replacement? Or addition?
For example, I have usecases and routes:
Test endpoints
GET /Test/ -> ReadAll Usecase
GET /Test/:id -> Read Usecase
POST /Test -> Create Usecase
PUT /Test/:id -> Update Usecase
DELETE /Test/:id -> Delete Usecase
OTHER /customgetallroute -> Other Usecase
If I pass the resourcename 'companies' it should look like this:
PUT /Test/companies/:id -> Update Usecase
Or
PUT /companies/:id -> Update Usecase
?
Would that make group replacement? Or addition?
If you want to follow the convention {httpVerb} /{resourceName}/:id
you can just inform resourceName
and a path will be generated for you.
If you want to override the convention, you can inform the path directly. Ex: /user/:id/update/foo/bla
.
:tada: This issue has been resolved in version 4.1.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Dependency: https://github.com/herbsjs/herbs2rest/issues/22
Being able to customize REST endpoints is extremely important since the current convention is just one of many possible configurations.
But instead of informing the library (herbs2rest) explicitly how to behave, we should use generic metadata to achieve that.
For instance:
Verbs:
URL path:
Resource: