lichunqiang / yii2-swagger

yii2 with swagger-php
https://packagist.org/packages/light/yii2-swagger
MIT License
151 stars 47 forks source link

Ignoring annotation issue #17

Open waqar-scorchsoft opened 5 years ago

waqar-scorchsoft commented 5 years ago
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="author@example.com"),
     ),
    @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.