creatify/swagger-builder
最新稳定版本:2.0.0
Composer 安装命令:
composer require creatify/swagger-builder
包简介
Generate Swagger Yaml And Json Files Based On Php Array
README 文档
README
Swagger Builder
Generate awesome swagger docs for your apis from php array
Installation
Use the package manager composer to install foobar.
composer require creatify/swagger-builder
Usage
# register the package service provider in config/app.php in providers array
Creatify\SwaggerBuilder\Providers\SwaggerBuilderServiceProvider::class,
# publish the needed files
php artisan vendor:publish --provider="Creatify\SwaggerBuilder\Providers\SwaggerBuilderServiceProvider"
php artisan vendor:publish --tag=swagger-builder
run the below command to start build your docs and select file format
php artisan swagger:build
# make new directory to save the php array which contain the structure of your endpoints
by default the path in public/swagger/endpoints
# make new php file which represents your endpoints with the below structure
<?php return [ 'schema' => [ 'id' => 'integer', 'name' => 'string', 'description' => 'string' ], 'store' => [ 'name' => 'string', 'description' => 'string' ], 'update' => [ 'name' => 'string', 'description' => 'string' ] ]; #schema represent the single response object of your model #store contains the needed data to store new model (store method request body) #update contains the needed data to update existing model (update method request body)
#start generating
php artisan swagger:generate
- Manage most used end points like:
- page
- index
- store
- show
- delete
- update
- restore
- force delete
- security is optional
- suggestion to the expected route path or can enter it
- detect the params from the given route path
- handle sorting, pagination length, search
- generate separate file for the given model for all above opetations
- support json and yaml
- can extend the above operations and add others
- have the route
/documentationto view the generated docs - supportes to multiple servers url from the config file
swagger-builder.php
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
统计信息
- 总下载量: 80
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-04-29



