2017 © Pedro Peláez
 

library swizzle

Build Guzzle service descriptions from Swagger compliant APIs

image

loco/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  • Friday, May 11, 2018
  • by timwhitlock
  • Repository
  • 2 Watchers
  • 25 Stars
  • 1,468 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

Swizzle

Build Guzzle service descriptions from Swagger compliant APIs., (*1)

What?

  • Guzzle is a framework for building HTTP clients in PHP.
  • Swagger is a specification for describing RESTful services.

Although Guzzle's service descriptions are heavily inspiried by the Swagger spec, they are different enough that we need something to bridge the divide., (*2)

Swizzle crawls JSON Swagger docs (such as ours) and transforms them into a compatible schema for use with guzzle/guzzle-services., (*3)

Important! This library is for use with v1.2 of the Swagger specification which is obsolete., (*4)

Installation

Installation is via Composer., (*5)

Add the latest stable version of loco/swizzle to your project's composer.json file as follows:, (*6)

{
  "require": {
    "loco/swizzle": "~2.0"
  }
}

If you want to install straight from Github you'll have to write your own autoloader for now., (*7)

Usage

Basic usage is to configure, build and export - as follows:, (*8)

$builder = new Loco\Utils\Swizzle\Swizzle( 'foo', 'Foo API' );
$builder->build('http://foo.bar/path/to/swagger/docs/');
// Serialize Guzzle service config to json
file_put_contents('/path/to/config.json', $builder->toJson());
// Now use saved config.json in your project/library to create Guzzle service.

More advanced usage includes registering custom Guzzle classes for commands and responses. See example directory for fuller, working examples., (*9)

Build the PHP API documentation with apigen using apigen -c apigen.yml, (*10)

Limitations

This library supports only version 1.2 of the old Swagger specification. We developed this very quickly for our own needs, and haven't kept up with the newer OpenAPI project., (*11)

The Versions

11/05 2018

dev-master

9999999-dev https://github.com/loco/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

api swagger guzzle

11/05 2018

2.0.1

2.0.1.0 https://github.com/loco/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

api swagger guzzle

14/02 2018

2.0.0

2.0.0.0 https://github.com/loco/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

api swagger guzzle

14/02 2018

dev-2.0-dev

dev-2.0-dev https://github.com/loco/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

api swagger guzzle

16/02 2014

1.0.4

1.0.4.0 https://github.com/loco-app/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

api swagger guzzle

15/02 2014

1.0.3

1.0.3.0 https://github.com/loco-app/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

api swagger guzzle

12/02 2014

1.0.2

1.0.2.0 https://github.com/loco-app/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

api swagger guzzle

10/02 2014

1.0.1

1.0.1.0 https://github.com/loco-app/swizzle

Build Guzzle service descriptions from Swagger compliant APIs

  Sources   Download

MIT

The Requires

 

api swagger guzzle