yii2-swagger icon indicating copy to clipboard operation
yii2-swagger copied to clipboard

Ignoring annotation issue

Open waqar-scorchsoft opened this issue 7 years ago • 0 comments

Class RestController
@package api\controllers
@SWG\Swagger(
     basePath="/api",
     produces={"application/json"},
     consumes={"application/x-www-form-urlencoded"},
     schemes={"http"},
     @SWG\Info(
         version="1.0.0",
         title="Api",
         @SWG\Contact(name="Author", email="[email protected]"),
     ),
    @SWG\SecurityScheme(
         securityDefinition="Bearer",
         type="apiKey",
         in="header",
         name="Authorization",
         description="Auth Bearer Token format as 'Bearer <access_token>'
    )
 )

For some reason the this section is completely ignored by parser. This generated result for the api is: {"swagger":"2.0","paths":{"/api/login":{"post":{"tags":["User"]... Which is clearly missing the basePath, info and security definitions.

waqar-scorchsoft avatar Aug 13 '18 16:08 waqar-scorchsoft