2017 © Pedro Peláez
 

library slagger

Slim middleware for generating Swagger json for use with Swagger UI

image

scrumptious/slagger

Slim middleware for generating Swagger json for use with Swagger UI

  • Friday, September 26, 2014
  • by schirinos
  • Repository
  • 1 Watchers
  • 9 Stars
  • 945 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 4 Versions
  • 6 % Grown

The README.md

Slagger

A Slim PHP middleware for generating swagger json for use with Swagger UI. This middleware will automatically add swagger json endpoints for all your Swagger doc annotated classes. Uses Zircote Swagger-php to parse annotations., (*1)

Install Using Composer

{
    "require": {
        "scrumptious\slagger": "0.3.0"
    }
}

Usage


$app = new \Slim\Slim(); // Inject as Slim application middleware $app->add(new \Slagger\Slagger('/api/v1/docs', __DIR__.'/../lib')); \\ ... your app code $app->run();

You'd then input the url http://yourapidomain.com/api/v1/docs in the Swagger-UI interface., (*2)

Slagger(docsuri, scandir, options)

The constructor takes up to three arguments., (*3)

docsuri

The uri in your app that will return swagger json., (*4)

scandir

The directory to scan for files with Swagger annotations., (*5)

options [optional]

Options passed through to the getResource function of the Zircote swagger-php library., (*6)

Annotations

The Zircote Swagger-php library will parse the Swagger annotations in your files. See the Swagger-php docs for what annotations are supported., (*7)

ex:, (*8)

/**
 * @SWG\Resource(
 *     apiVersion="0.1",
 *     swaggerVersion="1.2",
 *     resourcePath="/journey",
 *     basePath="http://myapi.com/api/v1"
 * )
 */
class Journey extends CRUD {
    // ...
}

The Versions

26/09 2014

dev-master

9999999-dev https://github.com/schirinos/slagger

Slim middleware for generating Swagger json for use with Swagger UI

  Sources   Download

MIT

The Requires

 

middleware json documentation swagger slim

26/09 2014

0.3.0

0.3.0.0 https://github.com/schirinos/slagger

Slim middleware for generating Swagger json for use with Swagger UI

  Sources   Download

MIT

The Requires

 

middleware json documentation swagger slim

17/05 2013

v0.2

0.2.0.0 https://github.com/schirinos/slagger

Slim middleware for generating Swagger json for use with Swagger UI

  Sources   Download

MIT

The Requires

 

middleware json documentation swagger slim

19/03 2013

v0.1

0.1.0.0 https://github.com/schirinos/slagger

Slim middleware for generating Swagger json for use with Swagger UI

  Sources   Download

MIT

The Requires

 

middleware json documentation swagger slim