I am implementing Swagger-PHP for an API we've built.
Here is a brief recap:
Language: PHP5.3
Framework: FuelPHP 1.5.3
Environment: Local (served with Nginx)
Now I have an API method defined as follow:
/**
* @SWG\Api(
* path="/site/list",
* description="Get sites list",
* @SWG\Operation(...,
* @SWG\Parameter(...),
* @SWG\ResponseMessage(...),
* @SWG\ResponseMessage(...)
* )
* )
*/
public function action_run()
{
//doing stuff
}
I now try the following (from elsewhere in my application) to generate the JSON:
$swagger = new Swagger\Swagger('my/root/dir');
$swagger->getResource('/site/list', array('output' => 'json'));
And that first line here (when instanciating my Swagger class) is throwing me an error:
ErrorException [ User Warning ]: [Semantical Error] The class
"package" is not annotated with @Annotation. Are you sure this class
can be used as annotation? If so, then you need to add @Annotation to
the class doc comment of "package". If it is indeed no annotation,
then you need to add @IgnoreAnnotation("package") to the class doc
comment of class @Swagger\Annotations\Api.
Adding the @IgnoreAnnotation("package")
is actually not helping.
I notice the error disappears if I remove the @package
from here:
https://github.com/zircote/swagger-php/blob/master/library/Swagger/Annotations/Api.php#L28
But that's not a solution.
I'm guessing this is mainly Doctrine-related but I can't seem to figure it out.
Thanks for any tips or ideas on that matter.