私は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のための注釈はsymfonyにルーティングするためのアノテーションと同じです。ところで
本番環境ではうまく動作しますが、開発環境で、私は
[Semantical Error] The annotation "@apiName" in method AppBundle\Controller\Api\apiDictionaryController::dictionaryListAction() was never imported.
のような例外がこの問題を修正し、apidocのための注釈が無視されなければならないことをsymfonyのに言うことはどのような方法があり得ますか?
であなたのバンドル内のコンパイラパスを登録する必要があり、[ここ](https://github.com/symfony/symfony/issues/17000)も – Matteo