2017 © Pedro Peláez
 

library openapi-php

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

image

erasys/openapi-php

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

  • Monday, April 30, 2018
  • by itsjavi
  • Repository
  • 10 Watchers
  • 0 Stars
  • 378 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 210 % Grown

The README.md

openapi-php

Latest Version on Packagist ![Software License][ico-license] Build Status Coverage Status ![Quality Score][ico-scrutinizer] ![Total Downloads][ico-downloads], (*1)

Open API 3.0 builder and validation library for PHP that helps you write valid specs., (*2)

This project is compliant with PSR-1, PSR-2 and PSR-4. If you notice compliance oversights, please send a patch via pull request., (*3)

Features

  • Fully documented object-oriented representation of the Open API 3.0+ specification with helper methods to write valid documents.
  • Supports Illuminate (Laravel) Jsonable and Arrayable.
  • Generates an specification in plain PHP arrays, plain objects, JSON or YAML.
  • Validates Open API documents against the Open API 3.0.x JSON Schema.

Install

Via Composer, (*4)

``` bash $ composer require erasys/openapi-php, (*5)


Via Git ``` bash $ git clone https://github.com/erasys/openapi-php.git

Usage

Basic example:, (*6)

<?php

use erasys\OpenApi\Spec\v3 as OASv3;

$doc = new OASv3\Document(
    new OASv3\Info('My API', '1.0.0', 'My API description'),
    [
        '/foo/bar' => new OASv3\PathItem(
            [
                'get' => new OASv3\Operation(
                    [
                        '200' => new OASv3\Response('Successful response.'),
                        'default' => new OASv3\Response('Default error response.'),
                    ]
                ),
            ]
        ),
    ]
);

$yaml = $doc->toYaml();
$json = $doc->toJson();
$arr  = $doc->toArray();
$obj  = $doc->toObject();

Testing

``` bash $ composer test, (*7)


or ``` bash $ vendor/bin/phpunit $ vendor/bin/phpcs

Contributing

Please see CONTRIBUTING for details., (*8)

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

30/04 2018

dev-master

9999999-dev http://github.com/erasys/openapi-php

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel swagger illuminate openapi oai oas openapi3 swagger3

30/04 2018

2.1.0

2.1.0.0 http://github.com/erasys/openapi-php

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel swagger illuminate openapi oai oas openapi3 swagger3

18/04 2018

2.0.0

2.0.0.0 http://github.com/erasys/openapi-php

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel swagger illuminate openapi oai oas openapi3 swagger3

17/04 2018

1.0.0

1.0.0.0 http://gitlab.adam/erasys/openapi-php

Open API 3.0 spec generator for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel swagger illuminate openapi oai oas openapi3 swagger3