1. Go to this page and download the library: Download phrity/slim-openapi library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phrity / slim-openapi example snippets
use Phrity\Slim\OpenApi;
use Slim\Factory\AppFactory;
// Create Slim App as you normally would
$slim = AppFactory::create();
// Create OpenApi adapter with OpenApi source
$openapi = new OpenApi('openapi.json');
// Push all routes from OpenApi to Slim
$openapi->route($slim);
// Run Slim
$slim->run();
json
{
"openapi": "3.0.0",
"paths": {
"/test": {
"get": {
"operationId": "Test/MyController",
"description": "Will invoke on class Test\\MyController"
},
"put": {
"operationId": "Test\\MyController:put",
"description": "Will call method put() on class Test\\MyController"
}
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.