frowhy / swagger2postman
Swagger Json Convert To Postman Json
v2.0.8
2016-12-20 02:55 UTC
Requires
- php: >=5.6
- ramsey/uuid: ^3.5
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Installation
The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:
composer require frowhy/swagger2postman
Examples
use Frowhy\Swagger2Postman; require_once __DIR__ . '/vendor/autoload.php'; header('Content-type: application/json'); $swagger2Postman = new Swagger2Postman(); $state = $swagger2Postman ->openFile('swagger.json') ->convertPostman() ->writeFile('postman.json'); $handle = fopen('swagger.json', 'r'); $swagger = fread($handle, filesize('swagger.json')); fclose($handle); $swagger2Postman = new Swagger2Postman(); $state = $swagger2Postman ->setSwagger($swagger) ->convertPostman() ->writeFile('postman.json'); $postman = $swagger2Postman ->openFile('swagger.json') ->convertPostman() ->getPostman(); echo $postman;