A package for Laravel that generates http clients to the service using OpenApi Generator. At the moment, there is support for one platform: PHP.
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"
Laravel OpenApi Client Generator | Laravel | PHP |
---|---|---|
^0.0.1 | ^7.x | ^7.1.3 |
^0.2.0 - ^0.8.3 | ^7.x | ^7.1.3 |
^0.8.4 | ^7.x | ^7.2.0 |
^0.9.0 | ^7.x || ^8.x | ^7.2.0 |
^0.10.0 - ^0.12.0 | ^7.x || ^8.x | ^7.2 || ^8.0 |
^0.12.1 | ^8.x || ^9.x | ^7.2 || ^8.0 |
^0.13.0 | ^8.x || ^9.x | ^8.1 |
^0.13.1 | ^8.x || ^9.x || ^10.x | ^8.1 |
^0.13.5 | ^8.x || ^9.x || ^10.x|| ^11.x | ^8.1 |
^0.14.0 | ^9.x || ^10.x|| ^11.x | ^8.1 |
-
Before launching, make sure that the api description structure meets these requirements.
-
Configure the generation parameters (if the default ones are not suitable).
-
Client Generation:
-
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
.
The package currently does not support generation in a Windows environment.
Please see CONTRIBUTING for details.
- composer install
- npm install
- composer test
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.