jdomenechb/openapi-class-generator

Generate PHP classes from given OpenAPI contracts.

dev-master 2019-09-29 10:56 UTC

This package is auto-updated.

Last update: 2024-04-21 21:13:48 UTC


README

Build Status Mutation testing badge

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.

Installation

composer require jdomenechb/openapi-class-generator

Usage

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