lts/php-openapi-generator

PHP OpenAPI 3.1+ code generator

Maintainers

Package info

github.com/LongTermSupport/php-openapi-generator

pkg:composer/lts/php-openapi-generator

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main / 1.x-dev 2026-03-24 19:21 UTC

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 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

  • 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

Maintained by

Long Term Support Ltdjoseph@ltscommerce.dev

Credits

License

MIT — see LICENSE. Original work copyright © 2016–2017 Joel Wurtz.