How do I get php-swagger to pick up my HTTP GET method
710
<?php
/**
* @SWG\Resource(
* basePath="http://dizplayzone.com/api",
* resourcePath="/account",
* description="Read information on a company dashboard",
* swaggerVersion="1.2",
* apiVersion="1.1",
* )
*/
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
$account = $app['controllers_factory'];
/**
* /account/{id}
*
However, swagger-php returns this JSON response:
{-code-2}
}
Note that it ignores the GET method HTTP operation ?? I think this exact syntax for the annotations worked fine a couple of hours ago, but I must have changed something because now it no longer works.... Any ideas ?
Answer
Answer
Answer
Solution:
Hmm strange, now I removed the entire annotation for GET, re-wrote it and re-inserted it and it it works....
Answer
Solution:
Now I found the reason why my GET method was ignored. It turns out that php-swagger will ignore any docblock that contains TABS even if the annotation structure is 100% correct. Hope this helps others