I'm using FOS Rest bundle to create a REST resource for a "persons" resource, basically the urls are meant to be:
- List: GET /api/persons
- Add: POST /api/persons
- Get single person: GET /api/persons/{id}
- Modify: PUT /api/persons/{id}
- Delete: DELETE /api/persons/{id}
So I defined my methods in the controllers as follows:
public function cgetPersonsAction() # List
public function cgetPersonAction(...) # Get single
public function cdeletePersonAction(...) # Delete
#etc...
And here comes the funny part, instead of /api/persons for get single, put, post and delete FOS Rest bundle calculates the plural of person into people instead of persons and the urls ended up being:
- List: GET /api/persons
- Add: POST /api/people
- Get single person: GET /api/people/{id}
- Modify: PUT /api/people/{id}
- Delete: DELETE /api/people/{id}
I searched the code looking for maybe some people/person in the bundle but I found nothing, so I guess it must be related with some php plural function.
Do you know if there's any way to force the url to remain being "person"? I think people doesn't make too much sense here