sturents/swagger-php-model-generator

0.2.2 2024-08-28 15:57 UTC

README

Generates simple models with no dependencies from a Swagger/Open API 2.0 file

Install using composer

composer require sturents/swagger-php-model-generator

Run with:

$generator = new SwaggerGen\GenerateAll('MyNamespace', '/path/to/api.yaml', '/path/to/library/src/');
echo $generator->saved_models.' - '.$generator->saved_requests;

Or run simply from this repo using:

php example.php --yaml-path /path/to/api.yaml --model-dir /path/to/generate/models --namespace MyNamespace