PHPackages                             lts/php-openapi-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lts/php-openapi-generator

ActiveLibrary[API Development](/categories/api)

lts/php-openapi-generator
=========================

PHP OpenAPI 3.1+ code generator

022PHP

Since May 20Pushed 1mo agoCompare

[ Source](https://github.com/LongTermSupport/php-openapi-generator)[ Packagist](https://packagist.org/packages/lts/php-openapi-generator)[ RSS](/packages/lts-php-openapi-generator/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

LTS PHP OpenAPI Generator
=========================

[](#lts-php-openapi-generator)

**Hard fork of [janephp/janephp](https://github.com/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?
--------------

[](#why-this-fork)

Jane PHP does not support OpenAPI 3.1 ([janephp/janephp#759](https://github.com/janephp/janephp/issues/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 `type` as 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
------------

[](#requirements)

- PHP 8.4+

Installation
------------

[](#installation)

```
composer require lts/php-openapi-generator
```

Usage
-----

[](#usage)

Generate a client from an OpenAPI 3.1 spec:

```
vendor/bin/php-openapi generate --config-file .php-openapi
```

Example `.php-openapi` config:

```
