The aim of this library is to turn an OpenAPI v.3.x contract into PHP classes ready to use for communicate with the service behind the contract.
composer require jdomenechb/openapi-class-generator
vendor/bin/ocg generate <inputPathFolder> <outputPathFolder>
WARNING: The contents of the output folder will be deleted entirely at each generation.
The namespace for the generated files can be defined by using --namespace
:
vendor/bin/ocg generate contracts src-generated --namespace An\\Org\\Namespace