creatify/swagger-builder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

creatify/swagger-builder

最新稳定版本:2.0.0

Composer 安装命令:

composer require creatify/swagger-builder

包简介

Generate Swagger Yaml And Json Files Based On Php Array

README 文档

README

pacakge

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
  1. Manage most used end points like:
  • page
  • index
  • store
  • show
  • delete
  • update
  • restore
  • force delete
  1. security is optional
  2. suggestion to the expected route path or can enter it
  3. detect the params from the given route path
  4. handle sorting, pagination length, search
  5. generate separate file for the given model for all above opetations
  6. support json and yaml
  7. can extend the above operations and add others
  8. have the route /documentation to view the generated docs
  9. supportes to multiple servers url from the config file swagger-builder.php

pacakge

pacakge

pacakge

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

统计信息

  • 总下载量: 80
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-04-29