I have a REST controller using the ParamConverter Symfony's service, using nelmio api doc annotation :
<?php
/**
* @param Plan $plan The plan id
*
* @ApiDoc(
* description="Returns plan details",
* output={
* "class"="AppBundle\Entity\Plan",
* "groups"={"details"}
* }
* )
*
* @return Response
*/
public function getAction(Plan $plan) // [...]
The api doc is correctly rendered but show a Plan
requirement type:
I want to rename my parameter to plan_id
and specify the integer
type.
So I tried with requirements
options, like this:
<?php
/**
* @param Plan $plan The plan id
*
* @ApiDoc(
* description="Returns plan details",
* requirements={
* {
* "name"="plan_id",
* "dataType"="integer",
* "requirement"="\d+",
* "description"="The plan's id"
* }
* },
* output={
* "class"="AppBundle\Entity\Plan",
* "groups"={"details"}
* }
* )
*
* @return Response
*/
public function getAction(Plan $plan) // [...]
But now it's showing me both parameters:
What is the best and proper method to override or remove @param
tag from api doc? Without remove it form comment doc of course...
Thanks for your help!