ensi/laravel-openapi-client-generator

laravel openapi client generator

0.14.1 2024-11-14 14:03 UTC

README

Latest Version on Packagist Tests Total Downloads

A package for Laravel that generates http clients to the service using OpenApi Generator. At the moment, there is support for one platform: PHP.

Installation

You can install the package via composer:

composer require ensi/laravel-openapi-client-generator --dev

Publish the config file with:

php artisan vendor:publish --provider="Ensi\LaravelOpenapiClientGenerator\OpenapiClientGeneratorServiceProvider"

Version Compatibility

Basic Usage:

  1. Before launching, make sure that the api description structure meets these requirements.

  2. Configure the generation parameters (if the default ones are not suitable).

  3. Client Generation:

  4. After successful generation, the client code will appear along the path <output_dir_template>-php, which can be put into git, the git_push script will be at the root, which is convenient to use for this. The corresponding repositories should already be created in the appropriate version control system. The full name of the repository is formed as follows: <git_user>/<git_repo_template>-php.

Limitations

The package currently does not support generation in a Windows environment.

Contributing

Please see CONTRIBUTING for details.

Testing

  1. composer install
  2. npm install
  3. composer test

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.