smillerdev/phpdraft
最新稳定版本:2.6.0
Composer 安装命令:
composer require smillerdev/phpdraft
包简介
This is a parser for API Blueprint files in PHP.
README 文档
README
This is a parser for API Blueprint files in PHP.1
Dependencies
PHPDraft requires drafter to be installed. Refer to the drafter page for the installation details. If you don't want to install drafter, you can pass -o to the command to make it use https://api.apiblueprint.org/parser
Usage
Requires PHP 8.1+ to run. Unittests require runkit or uopz For direct usage you can run:
$ ./phpdraft.phar -f blueprint-file.apib > blueprint-webpage.html
You can also install it first:
$ cp phpdraft.phar /usr/bin/phpdraft
$ chmod +x /usr/bin/phpdraft
$ phpdraft -f blueprint-file.apib > blueprint-webpage.html
Extra features
We got some fun stuff, check the wiki for more.
Writing API documentation
For writing API documentation using API Blueprint syntax. You can read about its specification.
Here's the example:
FORMAT: 1A HOST: https://api.example.com/v1 # Hello API A simple API demo # Group People This section describes about the People ## Person [/people/{id}] Represent particular Person + Parameters + id (required, string, `123`) ... The id of the Person. + Model (application/json) ``` {"name":"Gesang","birthdate":"01-09-1917"} ``` ### Retrieve Person [GET] Return the information for the Person + Request (application/json) + Headers ``` Authorization: Basic AbcdeFg= ``` + Response 200 (application/json) [Person][]
Building an executable
Install the binary dependencies with composer (composer install).
Run phing phar or phing phar-nightly
Libraries
This app usage the following libraries:
License
统计信息
- 总下载量: 11.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 38
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2016-11-16