Download the PHP package tanur/yii2-swagger without Composer
On this page you can find all versions of the php package tanur/yii2-swagger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tanur/yii2-swagger
More information about tanur/yii2-swagger
Files in tanur/yii2-swagger
Package yii2-swagger
Short Description Swagger Documentation Generator for Yii2 Framework
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
Support us
Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.
All versions of yii2-swagger with dependencies
yiisoft/yii2 Version ~2.0.12
zircote/swagger-php Version >=4.4
bower-asset/swagger-ui Version >=4.1