Add PHP example using generated client code
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
3be318a2c9
commit
e761038028
1 changed files with 18 additions and 0 deletions
18
openapi/example.php
Normal file
18
openapi/example.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
require_once __DIR__.'/out/php/vendor/autoload.php';
|
||||||
|
|
||||||
|
use GuzzleHttp\Client;
|
||||||
|
use OpenAPI\Client\Api\PetApi;
|
||||||
|
use OpenAPI\Client\Configuration;
|
||||||
|
|
||||||
|
$config = Configuration::getDefaultConfiguration()
|
||||||
|
->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
|
|
||||||
|
$api = new PetApi(new Client(), $config);
|
||||||
|
|
||||||
|
$pet = $api->getPetById(56);
|
||||||
|
|
||||||
|
var_dump($pet);
|
Loading…
Add table
Add a link
Reference in a new issue