delboy1978uk/bone-open-api

OpenApi package for Bone Framework

Installs: 317

Dependents: 1

Suggesters: 1

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:JavaScript

v1.3.0 2024-03-31 11:12 UTC

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. 😃