Nelmioapidocbundle: How can i generate documentation for route like login_check?

Created on 19 Feb 2014  路  6Comments  路  Source: nelmio/NelmioApiDocBundle

How can i generate documentation for route like login_check? because there are several routes which are not directally point to any method.

question

Most helpful comment

@ajaypatelbardoli You can define your route using annotations in a controller by creating an empty method (which won't be called because intercepted by the security) but the annotations will work (i think):

//MyController.php
/**
 * @ApiDoc(.....)
 *
 * @Post("/login_check", ....)
 */
public function checkAction(){...}

All 6 comments

What do you mean by saying "there are several routes which are not directally point to any method"?

like this

in app/routing.yml files
fb_login_check:
    path: /facebook/login_check/fb

for above routing pattern there is no controller and action defined. and i wants to generate doc for the above like pattern than how can i do?? i hope i have explained well :)

@ajaypatelbardoli Looks like a route for a login-endpoint. Requests to these routes are intercepted by Symfony's SecurityBundle (read more about). In general, you won't such endpoints to be documented, but interesting question.

@frne agreed but i wish it will be available in next release :)

@ajaypatelbardoli You can define your route using annotations in a controller by creating an empty method (which won't be called because intercepted by the security) but the annotations will work (i think):

//MyController.php
/**
 * @ApiDoc(.....)
 *
 * @Post("/login_check", ....)
 */
public function checkAction(){...}

@ajaypatelbardoli You can define your route using annotations in a controller by creating an empty method (which won't be called because intercepted by the security) but the annotations will work (i think):

//MyController.php
/**
 * @ApiDoc(.....)
 *
 * @Post("/login_check", ....)
 */
public function checkAction(){...}

That helped, thanks so much!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

numediaweb picture numediaweb  路  4Comments

manseuk picture manseuk  路  6Comments

BafS picture BafS  路  3Comments

andydandy80 picture andydandy80  路  4Comments

timotheemoulin picture timotheemoulin  路  5Comments