2017 © Pedro Peláez
 

library slim-swagger

Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP

image

terwey/slim-swagger

Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP

  • Sunday, February 15, 2015
  • by terwey
  • Repository
  • 1 Watchers
  • 14 Stars
  • 436 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

SlimSwagger

A Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP., (*1)

Installation

Easiest is using Composer:, (*2)

composer require terwey/slim-swagger

Adding it to Slim is easy too:, (*3)

$app->add(new \terwey\SlimSwagger(array(), array('baseDir' => __DIR__.'/../src/')));

Where src/ is the directory you keep your API endpoint or Models., (*4)

Resources

For now you'll have to grab a release of Swagger-UI and copy /lib and /css to your /public directory. Also copy over swagger-ui.min.js to the /public/lib directory., (*5)

Template

I've provided a Twig template in the /templates directory. Copy this over to your Slim application. If you want to use Twig also install Slim Views., (*6)

Docs

The SlimSwagger class takes 2 parameters. The first one is the $swaggerSettings array, please see the Swagger-PHP docs for more info., (*7)

$swaggerSettings = array(
    'output' => 'json',
    'apiVersion' => $defaultApiVersion,
    'swaggerVersion' => $defaultSwaggerVersion,
    'defaultSwaggerVersion' => $resourceList['swaggerVersion'],
    'defaultBasePath' => $defaultBasePath
);

The second one is the $options array., (*8)

$options = array(
    'baseDir' => __DIR__.'/../',
    'ignoreDir' => array()
);

The Versions

15/02 2015

dev-master

9999999-dev

Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP

  Sources   Download

MIT

The Requires

 

24/01 2015

0.0.3

0.0.3.0

Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP

  Sources   Download

MIT

The Requires

 

24/01 2015

0.0.2

0.0.2.0

Slim Middleware for generating Swagger documentation on the fly with Swagger-PHP

  Sources   Download

MIT

The Requires