Laravel component to load an OpenAPIY JSON file and assist in consuming the underlying API.
bedezign/laravel-openapi-consumer is a Laravel package for laravel component to load an openapiy json file and assist in consuming the underlying api..
It currently has 3 GitHub stars and 24 downloads on Packagist.
Install it with composer require bedezign/laravel-openapi-consumer.
Discover more Laravel packages by bedezign
or browse all Laravel packages to compare alternatives.
Last updated
PoC to see if it is possible to automatically consume an API that has an OpenAPI specification (pka Swagger).
At this point the library is written for laravel.
If you need to use it, simply create a Client instance with the correct configuration
$api = new \OpenAPI\Consumer\Client('json specification path', [<extra configuration>])
You can then call any operation from the API in a very simplistic way:
$call = $api->operationName->with(['api-data' => 'api-data-value'])->execute();
if ($call->statusCode == 200) {
dd($call->json);
}