I'm using FOS Rest bundle to create a REST resource for a "persons" resource, basically the urls are meant to be:
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:
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
You can force the url by using:
FOS\RestBundle\Controller\Annotations\Get; ...\Post; ,...
For GET url it would be:
@Get("api/whatever/{id}")