Question

I create an API RESTfull using Symfony2.1 with FOSRESTBundle and I am using NelmioApiDocBundle to generate automatic documentation.

I have a PUT request in which the user should send one parameter, but I don't need to create a Form for this purpose. All works perfectly but when I generate the documentation I don't know how to add this parameter to the documentation because I don't have a 'input' form.

I tried this but seems doesn't work:

 /**
 * @ApiDoc(
 *  description="description",
 *  statusCodes={
 *         200="Success",
 *         400="Bad request"},
 *  parameters={
 *         {"name"="parameter_name", "dataType"="integer"}
 *  }
 * )
 ...

In the documentation of NelmioApiDocBundle I didn't see any solution for this...

Was it helpful?

Solution

use filters key instead of parameters

 * filters={
 *     {"name"="parameter_name", "dataType"="integer"},
 * },
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top