smillerdev / phpdraft
This is a parser for API Blueprint files in PHP.
Fund package maintenance!
smillerdev
Installs: 10 374
Dependents: 0
Suggesters: 0
Security: 0
Stars: 38
Watchers: 3
Forks: 6
Open Issues: 8
Language:HTML
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- lukasoppermann/http-status: ~4.0
- matthiasmullie/minify: ^1.3
- michelf/php-markdown: ~2.0
- rize/uri-template: *
- twig/markdown-extra: ^3.0
- twig/twig: ^3.0
- vanilla/garden-cli: ~4.0
Requires (Dev)
- lunr/halo: ~0.10.0
- phing/phing: ~3.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.2.0
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.0.0
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ~10.0
- theseer/autoload: ~1.0
- dev-main
- 2.6.0
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0.2
- 2.4.0.1
- 2.4.0
- 2.4.0-rc6
- 2.4.0-rc5
- 2.4.0-rc4
- 2.4.0-rc3
- 2.4.0-rc2
- 2.4.0-rc1
- 2.3.0
- 2.2.1
- 2.2
- 2.1.1
- 2.1
- 2.0.1
- 2.0.0
- 1.15.10
- 1.15.9
- 1.15.8
- 1.15.7
- 1.15.6
- 1.15.5
- 1.15.4
- 1.15.3
- 1.15.2
- 1.15.1
- 1.15.0
- 1.14.1.2
- 1.14.1.1
- 1.14.1
- 1.14
- 1.13.3
- 1.13.2
- 1.13.1
- 1.13
- 1.12
- 1.11.1
- 1.11
- 1.10
- 1.9.2
- 1.9.1
- 1.9
- 1.9-beta.2
- 1.9-beta
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8
- 1.7.1
- 1.7
- 1.6
- 1.5
- dev-dependabot/composer/phpunit/phpunit-11.5.2
- dev-dependabot/composer/phpunit/phpunit-11.5.1
- dev-chore/php80
- dev-fix/phpstan/types
- dev-SMillerDev-patch-2
This package is auto-updated.
Last update: 2024-12-23 20:59:50 UTC
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: