저는 Symfony 프레임 워크를 사용하고 있으며 내 프로젝트의 RESTful API에 자동 문서 엔진을 추가하려고합니다.Symfony - 주석을 가져 오지 않았습니다
일부 검색 후 apidoc 엔진 (http://apidocjs.com/)을 발견했습니다. 그것은 아주 간단하게 작동합니다. 여러분은 RESTful API와 문서가 생성 될 모든 컨트롤러에 대한 주석을 추가해야합니다.
주석의 예는 다음과 같습니다
/**
* @Route("/api/dictionary_list/{userId}/{sessionKey}", name="api/dictionary_list")
* @api {get} /api/dictionary_list/{userId}/{sessionKey} 01. Values list (ids) for all system dictionaries
* @apiName Dictionary list
* @apiGroup Dictionary
*
* @apiParam {Integer} userId User's ID received in authorization request
* @apiParam {String} sessionKey Session key received in authorization request
*
* @apiSuccess {Integer} parcelStatuses The name of current dictionary
* @apiSuccess {String} itemId Item id which used in requests
* @apiSuccess {String} itemName Item name
*/
public function dictionaryListAction($userId=null, $sessionKey=null)
{
...
}
당신이 볼 수 있듯이, apidoc에 대한 주석이 심포니에서 라우팅에 대한 주석과 동일합니다. 잘 작동 프로덕션 환경에서 그런데
하지만, 개발 환경에서 나는[Semantical Error] The annotation "@apiName" in method AppBundle\Controller\Api\apiDictionaryController::dictionaryListAction() was never imported.
같은 예외가 무시 될 수있다 apidoc에 대한 그 주석이 문제를 해결하고 심포니에 말을 어떤 방법이 있나요거야?
논의 [여기] (https://github.com/symfony/symfony/issues/17000)도 – Matteo