2016-12-14 8 views
1

APIのカスタムルート名を定義しようとしましたが、それ以来API Docはそのルートを2度表示しています。なぜどんなアイデア?Nelmio API Docにカスタムルートが2回表示されるのはなぜですか?

ここでは私のAPIの定義です:

/** 
* @ApiDoc(
* description = "Sends the support email to the HelpDesk address", 
* statusCodes = { 
*  204 = "Returned when successful", 
*  400 = "Returned when the parameters are incorrect", 
*  401 = "Returned when the token is invalid", 
*  500 = "Returned when there's an internal server error" 
* }, 
* input="AppBundle\Form\Type\SupportEmailType" 
*) 
* @Post("/support-requests") 
* @Rest\View() 
*/ 
public function postSupportAction(Request $request) 

、ここでは、ルートが私のdocに表示方法は次のとおりです。 enter image description here

そして、これは私のrouting.ymlファイルです:

# app/config/routing.yml 
app: 
    resource: "@AppBundle/Controller/" 
    type:  annotation 
NelmioApiDocBundle: 
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml" 
    prefix: /api/doc 
user: 
    type:  rest 
    resource: AppBundle\Controller\UserController 
+1

役立ちますあなたが同様のrouting.yml設定を投稿することができますか? –

+0

@AlexandruCosoi私はrouting.ymlファイルの内容で質問を更新しました – Sebastian

+0

FOSRestBundleを最後に使用したときは思い出せませんが、私はどこかで2度定義されたルートを持っていると思っていますこの問題:https://github.com/FriendsOfSymfony/FOSRestBundle/issues/813 –

答えて

1

からその外観は、これを行う可能性を持っているとして心に来る唯一のものは、あなたのrouting.ymlの最初の部分です

は、あなたのrouting.yml私はこのコードを考えて

app: 
    resource: "@AppBundle/Controller/" 
    type:  annotation 

からこれを削除してみて、ユーザの経路の分離定義は二回、ルートを確認nelmioます。私は以前も同様の問題を抱えていましたが、これが理由だと思います。私は尋ねなければならなかった質問の量を申し訳ありませんが、私は完全な絵を見る必要がありました。

希望これは、

アレクサンドルCosoi

+0

Sătrăieşti! :D! – Sebastian

+0

Cu placere :)。楽しむ –

関連する問題