delboy1978uk / bone-open-api
OpenApi package for Bone Framework
Installs: 395
Dependents: 1
Suggesters: 1
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: ^8.2
- laminas/laminas-diactoros: ^3.3
- zircote/swagger-php: ^4.8.
Requires (Dev)
- roave/security-advisories: dev-master
README
OpenApi package for Bone Mvc Framework
installation
Use Composer
composer require delboy1978uk/open-api
usage
Simply add to the config/packages.php
<?php // use statements here use Bone\OpenApi\OpenApi\OpenApiPackage; return [ 'packages' => [ // packages here..., OpenApiPackage::class, ], // ... ];
Create a config array entry/file. You can add a client so the docs page can authorize and test your endpoints.
<?php return [ 'docs' => 'data/docs/api.json', 'swaggerClient' => [ 'clientId' => '', 'clientSecret' => '', ], ];
Run booty to deploy the front end assets.
vendor/bin/bone assets:deploy
Scan for your API annotations.
vendor/bin/bone docs:generate
Now you can head to /api/docs
to view your API documentation. 😃