Skip to content

LongTermSupport/php-openapi-generator

Repository files navigation

LTS PHP OpenAPI Generator

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors