lts / php-openapi-generator
PHP OpenAPI 3.1+ code generator
Package info
github.com/LongTermSupport/php-openapi-generator
pkg:composer/lts/php-openapi-generator
Requires
- php: ^8.4
- ext-json: *
- doctrine/inflector: ^2.0
- league/uri: ^6.7.2 || ^7.4
- nikic/php-parser: ^5.1
- php-http/client-common: ^2.7
- php-http/discovery: ^1.19
- php-http/multipart-stream-builder: ^1.3
- php-jsonpointer/php-jsonpointer: ^4.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- symfony/console: ^6.4 || ^7.0 || ^8.0
- symfony/filesystem: ^6.4 || ^7.0 || ^8.0
- symfony/options-resolver: ^6.4 || ^7.0 || ^8.0
- symfony/property-info: ^6.4 || ^7.0 || ^8.0
- symfony/serializer: ^6.4 || ^7.0 || ^8.0
- symfony/string: ^6.4 || ^7.0 || ^8.0
- symfony/validator: ^6.4 || ^7.0 || ^8.0
- symfony/var-dumper: ^6.4 || ^7.0 || ^8.0
- symfony/yaml: ^6.4 || ^7.0 || ^8.0
Requires (Dev)
- doctrine/annotations: ^2.0
- friendsofphp/php-cs-fixer: ^3.59
- jms/serializer: ^3.28
- lts/php-qa-ci: dev-php8.4@dev
- lts/strict-openapi-validator: dev-main
- moneyphp/money: ^3.3
- nyholm/psr7: ^1.8
- phpbench/phpbench: ^1.3
- phpdocumentor/reflection-docblock: ^5.3
- phpunit/phpunit: ^11.0
- symfony/framework-bundle: ^6.4 || ^7.0 || ^8.0
- symfony/http-client: ^6.4 || ^7.0 || ^8.0
- symfony/uid: ^6.4 || ^7.0 || ^8.0
Suggests
- friendsofphp/php-cs-fixer: Allow to automatically fix cs on generated code for better visualisation
- phpdocumentor/reflection-docblock: Allow to extract informations from PHP Doc blocks
This package is auto-updated.
Last update: 2026-03-24 19:30:47 UTC
README
Hard fork of janephp/janephp with OpenAPI 3.1 support.
A set of libraries to generate PHP models and API clients from OpenAPI 3.1 specifications.
Why this fork?
Jane PHP does not support OpenAPI 3.1 (janephp/janephp#759). OAS 3.1 has been the current standard since February 2021, and many API providers publish 3.1 specs exclusively. The upstream maintainers have indicated they welcome PRs but have no roadmap for 3.1 support.
This fork adds:
- Full OpenAPI 3.1 support — handles
typeas array (e.g.["string", "null"]), nullable via type arrays,const,$schema, and other 3.1 features - PHP 8.4 — requires and targets modern PHP
- PHPUnit 11 — test suite fully updated to PHPUnit 11 conventions
- Strict OpenAPI spec validation via
lts/strict-openapi-validator
Requirements
- PHP 8.4+
Installation
composer require longtermsupp/php-openapi-generator
Usage
Generate a client from an OpenAPI 3.1 spec:
vendor/bin/jane-openapi generate --config-file .jane-openapi
Example .jane-openapi config:
<?php return [ 'openapi-file' => __DIR__ . '/openapi.yaml', 'namespace' => 'MyApp\Client', 'directory' => __DIR__ . '/generated', ];
Upstream
- Original repository: janephp/janephp
- Original documentation: jane.jolicode.com
- Original license: MIT
Maintained by
Long Term Support Ltd — joseph@ltscommerce.dev
Credits
- JoliCode for creating and maintaining Jane PHP
- All original janephp contributors
- Joel Wurtz — original author
- Baptiste Leduc — major contributor
- Alexandre Godreau for the original logo
License
MIT — see LICENSE. Original work copyright © 2016–2017 Joel Wurtz.