PHP code example of avalanche-development / swagger-header-middleware

1. Go to this page and download the library: Download avalanche-development/swagger-header-middleware 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/ */

    

avalanche-development / swagger-header-middleware example snippets


$header = new AvalancheDevelopment\SwaggerHeaderMiddleware\Header;
$result = $header($request, $response, $next); // middleware signature

$header = new AvalancheDevelopment\SwaggerHeaderMiddleware\Header;
$header->setLogger($logger);
... etc

$swagger = $request->getAttribute('swagger');
var_dump($swagger);
...
[
  'produces' => [
    'application/json',
  ],
  'consumes' => [
    'application/json',
  ],
]