Symfony 2.3.4 및 FOSRestBundle 0.13.1을 사용하고 있습니다. FOSRestBundle에서 자동 생성 할 경로를 구성했습니다. Eveything은 @QueryParam 주석을 어떤 메서드에 추가 할 때까지 훌륭하게 작동합니다. 이 주석은 경로를 변경하고 urara에서 추출 할 수있는 대신 매개 변수로 전달 될 것으로 기대합니다.@QueryParam을 사용한 FOSRES 번들 경로
즉
/**
* @return array
* @Rest\View
*/
public function getDetailsAction($user) {
......
}
-bash-4.2$ php app/console router:debug
get_details GET ANY ANY /api/users/details/{user}
하지만 곧 나는 @QueryParam 주석을 추가 할 때, 내 경로 변경 :
/**
* @QueryParam(name="user", requirements="\w+", strict=true, nullable=false, description="Name of the user to query details for")
* @return array
* @Rest\View
*/
public function getDetailsAction($user) {
......
}
-bash-4.2$ php app/console router:debug
get_details GET ANY ANY /api/users/details
왜 내 경로가 변경된다? 원래 경로를 유지하고 @QueryParam 주석을 동시에 사용할 수 있습니까?
QueryParam
주석을 사용하여