epfremme / swagger-php
Library for parsing swagger documentation into PHP entities for use in testing and code generation
Installs: 1 331 672
Dependents: 1
Suggesters: 0
Security: 0
Stars: 31
Watchers: 5
Forks: 10
Open Issues: 3
Type:package
Requires
- php: >=5.5
- doctrine/annotations: ^1.2
- doctrine/collections: ^1.3
- jms/serializer: ^1.1
- phpoption/phpoption: ^1.1
- symfony/yaml: ^2.7|^3.1
Requires (Dev)
- mockery/mockery: ^0.9.4
- phpunit/phpunit: ~4.8|~5.0
- satooshi/php-coveralls: ^1.0
README
Library for parsing swagger documentation into PHP entities for use in testing and code generation
Installation
- Require package
composer require epfremme/swagger-php
- Install packages
composer install
Basic Usage
Instantiate the swagger factory and pass it a valid swagger documentation file to parse:
use Epfremme\Swagger\Factory\SwaggerFactory;
$factory = new SwaggerFactory();
$swagger = $factory->build('/path/to/swagger/file.json');
// do stuff with your Swagger entity
Swagger Definitions
Visit the swagger specification for more information on creating valid swagger json/yaml documentation
Support
Currently only swagger version 2.0 is supported in both JSON and YAML format