Download the PHP package breadhead/yii2-swagger without Composer
On this page you can find all versions of the php package breadhead/yii2-swagger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download breadhead/yii2-swagger
More information about breadhead/yii2-swagger
Files in breadhead/yii2-swagger
Package yii2-swagger
Short Description Swagger Documentation Generator for Yii2 Framework with swagger v3.0
License MIT
Informations about the package yii2-swagger
Swagger Documentation Generator for Yii2 Framework
Swagger/OpenAPI Documentation Generator for Yii2 Framework.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json.
Configuration
You need to configure two actions as follows:
Usage
1) Creating a Controller
First, create a controller class app\controllers\UserController
as follows:
2) Creating User
definition
You need to create folder app/models/definitions
and add User
definition class as follows:
3) Configuring URL Rules
Then, modify the configuration of the urlManager component in your application configuration:
4) Enabling JSON Input
To let the API accept input data in JSON format, configure the parsers property of the request application component to use the yii\web\JsonParser
for JSON input:
Trying it Out
Now you can access to swagger documentation section through the following URL:
http://localhost/path/to/index.php?r=site/docs
View in the browser
All versions of yii2-swagger with dependencies
yiisoft/yii2 Version ~2.0.12
zircote/swagger-php Version ^3.0
bower-asset/swagger-ui Version ^3.1