I created a basic Symfony4 API using FOSRestBundle 2.3.1 and NelmioApiDocBundle 3.1. I confirm Nelmio was able to parse my FOS\RestBundle\Controller\Annotations\QueryParam annotation and generate the right doc.
My Controller:
<?phpnamespaceApp\Controller;useFOS\RestBundle\Request\ParamFetcher;useFOS\RestBundle\Controller\Annotations\RequestParam;useFOS\RestBundle\Controller\Annotations\QueryParam;useFOS\RestBundle\Controller\Annotations\FileParam;useAcme\FooBundle\Validation\Constraints\MyComplexConstraint;useSymfony\Component\Routing\Annotation\Route;classFooController{/**
* @QueryParam(name="page", requirements="\d+", default="1", description="Page of the overview.")
* @Route("/api/rewards", methods={"GET"})
* @param ParamFetcher $paramFetcher
*/publicfunctionaaa(ParamFetcher$paramFetcher){}}
The computed swagger file:
{"swagger":"2.0","info":{"title":"My App","description":"This is an awesome app!","version":"1.0.0"},"paths":{"\/api\/rewards":{"get":{"parameters":[{"name":"page","in":"query","allowEmptyValue":false,"required":false,"description":"Page of the overview.","type":"string","format":"\\d+","default":"1"}],"responses":{"default":{"description":""}}}},"\/api\/doc.json":{"get":{"responses":{"default":{"description":""}}}}}}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I created a basic Symfony4 API using FOSRestBundle 2.3.1 and NelmioApiDocBundle 3.1. I confirm Nelmio was able to parse my
FOS\RestBundle\Controller\Annotations\QueryParam
annotation and generate the right doc.My Controller:
The computed swagger file: