jdomenechb / openapi-class-generator
Generate PHP classes from given OpenAPI contracts.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jdomenechb/openapi-class-generator
Requires
- php: >=7.1
- ext-json: *
- cebe/php-openapi: ^1.2
- doctrine/inflector: ^1.3
- guzzlehttp/guzzle: ^6.3
- nette/php-generator: ^3.2
- psr/http-client: ^1.0
- symfony/console: ^4.3
- symfony/filesystem: ^4.3
- symfony/finder: ^4.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- infection/infection: ^0.13.6
- mikey179/vfsstream: ^1.6
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.11.15
- phpstan/phpstan-phpunit: ^0.11.2
- phpunit/phpunit: ^7.5
- rregeer/phpunit-coverage-check: ^0.2.0
- vimeo/psalm: ^3.5
This package is auto-updated.
Last update: 2025-09-22 00:45:17 UTC
README
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