All URIs are relative to http://petstore.swagger.io/v2
| Method | HTTP request | Description |
|---|---|---|
| addPet | POST /pet | Add a new pet to the store |
| deletePet | DELETE /pet/{petId} | Deletes a pet |
| downloadFile | GET /pet/{petId}/downloadImage | downloads an image |
| findPetsByStatus | GET /pet/findByStatus | Finds Pets by status |
| findPetsByTags | GET /pet/findByTags | Finds Pets by tags |
| getPetById | GET /pet/{petId} | Find pet by ID |
| petAge | GET /pet/{petId}/age | Get the age of the pet |
| petAvailableForSale | GET /pet/{petId}/available-for-sale | Whether the pet can currently be bought |
| updatePet | PUT /pet | Update an existing pet |
| updatePetWithForm | POST /pet/{petId} | Updates a pet in the store with form data |
| uploadFile | POST /pet/{petId}/uploadImage | uploads an image |
# config/services.yaml
services:
# ...
Acme\MyBundle\Api\PetApi:
tags:
- { name: "open_api_server.api", api: "pet" }
# ...OpenAPI\Server\Model\Pet addPet($pet)
Add a new pet to the store
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure OAuth2 access token for authorization: petstore_auth
*/
public function setpetstore_auth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
// ...
/**
* Implementation of PetApiInterface#addPet
*/
public function addPet(Pet $pet, int &$responseCode, array &$responseHeaders): array|object|null
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| pet | OpenAPI\Server\Model\Pet | Pet object that needs to be added to the store |
- Content-Type: application/json, application/xml
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deletePet($petId, $apiKey)
Deletes a pet
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure OAuth2 access token for authorization: petstore_auth
*/
public function setpetstore_auth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
// ...
/**
* Implementation of PetApiInterface#deletePet
*/
public function deletePet(int $petId, ?string $apiKey, int &$responseCode, array &$responseHeaders): void
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| petId | int | Pet id to delete | |
| apiKey | string | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UploadedFile downloadFile($petId)
downloads an image
response may be an image
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
// ...
/**
* Implementation of PetApiInterface#downloadFile
*/
public function downloadFile(int $petId, int &$responseCode, array &$responseHeaders): mixed
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| petId | int | ID of pet to download an image from |
UploadedFile
No authorization required
- Content-Type: Not defined
- Accept: image/png
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OpenAPI\Server\Model\Pet findPetsByStatus($status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure OAuth2 access token for authorization: petstore_auth
*/
public function setpetstore_auth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
// ...
/**
* Implementation of PetApiInterface#findPetsByStatus
*/
public function findPetsByStatus(array $status, int &$responseCode, array &$responseHeaders): array|object|null
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| status | string | Status values that need to be considered for filter |
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OpenAPI\Server\Model\Pet findPetsByTags($tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure OAuth2 access token for authorization: petstore_auth
*/
public function setpetstore_auth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
// ...
/**
* Implementation of PetApiInterface#findPetsByTags
*/
public function findPetsByTags(array $tags, int &$responseCode, array &$responseHeaders): array|object|null
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| tags | string | Tags to filter by |
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OpenAPI\Server\Model\Pet getPetById($petId)
Find pet by ID
Returns a single pet
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure API key authorization: api_key
*/
public function setapi_key($apiKey)
{
// Retrieve logged in user from $apiKey ...
}
// ...
/**
* Implementation of PetApiInterface#getPetById
*/
public function getPetById(int $petId, int &$responseCode, array &$responseHeaders): array|object|null
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| petId | int | ID of pet to return |
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
int petAge($petId)
Get the age of the pet
response may be an int
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
// ...
/**
* Implementation of PetApiInterface#petAge
*/
public function petAge(int $petId, int &$responseCode, array &$responseHeaders): int
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| petId | int | ID of pet |
int
No authorization required
- Content-Type: Not defined
- Accept: text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
bool petAvailableForSale($petId)
Whether the pet can currently be bought
response may be a boolean
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
// ...
/**
* Implementation of PetApiInterface#petAvailableForSale
*/
public function petAvailableForSale(int $petId, int &$responseCode, array &$responseHeaders): bool
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| petId | int | ID of pet |
bool
No authorization required
- Content-Type: Not defined
- Accept: text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OpenAPI\Server\Model\Pet updatePet($pet)
Update an existing pet
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure OAuth2 access token for authorization: petstore_auth
*/
public function setpetstore_auth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
// ...
/**
* Implementation of PetApiInterface#updatePet
*/
public function updatePet(Pet $pet, int &$responseCode, array &$responseHeaders): array|object|null
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| pet | OpenAPI\Server\Model\Pet | Pet object that needs to be added to the store |
- Content-Type: application/json, application/xml
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updatePetWithForm($petId, $name, $status)
Updates a pet in the store with form data
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure OAuth2 access token for authorization: petstore_auth
*/
public function setpetstore_auth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
// ...
/**
* Implementation of PetApiInterface#updatePetWithForm
*/
public function updatePetWithForm(int $petId, ?string $name, ?string $status, int &$responseCode, array &$responseHeaders): void
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| petId | int | ID of pet that needs to be updated | |
| name | string | Updated name of the pet | [optional] |
| status | string | Updated status of the pet | [optional] |
void (empty response body)
- Content-Type: application/x-www-form-urlencoded
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OpenAPI\Server\Model\ApiResponse uploadFile($petId, $additionalMetadata, $file)
uploads an image
<?php
// src/Acme/MyBundle/Api/PetApiInterface.php
namespace Acme\MyBundle\Api;
use OpenAPI\Server\Api\PetApiInterface;
class PetApi implements PetApiInterface
{
/**
* Configure OAuth2 access token for authorization: petstore_auth
*/
public function setpetstore_auth($oauthToken)
{
// Retrieve logged in user from $oauthToken ...
}
// ...
/**
* Implementation of PetApiInterface#uploadFile
*/
public function uploadFile(int $petId, ?string $additionalMetadata, ?UploadedFile $file, int &$responseCode, array &$responseHeaders): array|object|null
{
// Implement the operation ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| petId | int | ID of pet to update | |
| additionalMetadata | string | Additional data to pass to server | [optional] |
| file | UploadedFile****UploadedFile | file to upload | [optional] |
OpenAPI\Server\Model\ApiResponse
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]