th3mouk/openapi-generator
Composer 安装命令:
composer require th3mouk/openapi-generator
包简介
PHP library which provide a scaffolding and generate an OpenAPI file
README 文档
README
This PHP library allows you to cut and organize your HUGE openapi.yml file, into small slices.
Versioning and deploy your OpenAPI documentation become easier.
Installation
composer require th3mouk/openapi-generator
Usage
Inside your project you can now run additional commands:
vendor/bin/openapi scaffoldvendor/bin/openapi generate
Scaffold
To prepare your project, run the first command scaffold.
It will create new folders.
specs ├── components │ ├── schemas │ ├── responses │ ├── parameters │ ├── examples │ ├── requestBodies │ ├── headers │ ├── securitySchemes │ ├── links │ └── callbacks └── paths
Add your schema
I personnaly use Swagger OpenAPI specifications to write my schema.
One example of organization can be :
specs
├── components
└── paths
├── authentication
│ ├── login.yaml
│ └── register.yaml
└── unicorn
├── list.yaml
└── detail.yaml
Generate
The command vendor/bin/openapi generate take arguments and options to generate the openapi.yml file.
You can add a path like this vendor/bin/openapi generate /in-this-folder/sub
And it exists a --pretty-json or -p option to obtain a human readable file.
Please
Feel free to improve this library.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-27