You must declare a route with the same name immediately after the setting that you set. For example, the following work.
users: type: rest resource: Project\RESTBundle\Controller\UsersController get_users: pattern: /api/users/customUri.{_format} defaults: { _controller: ProjectRESTBundle:Users:indexAction, _format: json }
source share