forked from loafle/openapi-generator-original
[PHP-Symfony] Encurage Symfony 5 bundle directory structure best practices (#13014)
* use .yaml instead of .yml This is recommended by Symfony standards * save Bundle files also to src path * add test for generate ping * add package imports * fix expected file names * why is Api/ApiServer.php missing * output filenames * use getAbsolutePath for debug purpose * do not use punctuation as current directory * refactor: remove todos * use also .yaml in test to fix it * add test for setting a different source directory * use correct const for setting source dir property in tests * import the AbstractPhpCodegen in test class * put also Resources to source path * save docs not to Resources * update samples and improve src path in autoload.php and composer.json * update moved samples
This commit is contained in:
@@ -0,0 +1,528 @@
|
||||
# OpenAPI\Server\Api\PetApiInterface
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**addPet**](PetApiInterface.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**deletePet**](PetApiInterface.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](PetApiInterface.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](PetApiInterface.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](PetApiInterface.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**updatePet**](PetApiInterface.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithForm**](PetApiInterface.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](PetApiInterface.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
|
||||
|
||||
## Service Declaration
|
||||
```yaml
|
||||
# config/services.yaml
|
||||
services:
|
||||
# ...
|
||||
Acme\MyBundle\Api\PetApi:
|
||||
tags:
|
||||
- { name: "open_api_server.api", api: "pet" }
|
||||
# ...
|
||||
```
|
||||
|
||||
## **addPet**
|
||||
> OpenAPI\Server\Model\Pet addPet($pet)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**OpenAPI\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\Pet**](../Model/Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **deletePet**
|
||||
> deletePet($petId, $apiKey)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **int**| Pet id to delete |
|
||||
**apiKey** | **string**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **findPetsByStatus**
|
||||
> OpenAPI\Server\Model\Pet findPetsByStatus($status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**string**](../Model/string.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\Pet**](../Model/Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **findPetsByTags**
|
||||
> 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.
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**string**](../Model/string.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\Pet**](../Model/Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **getPetById**
|
||||
> OpenAPI\Server\Model\Pet getPetById($petId)
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a single pet
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **int**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\Pet**](../Model/Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **updatePet**
|
||||
> OpenAPI\Server\Model\Pet updatePet($pet)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**OpenAPI\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\Pet**](../Model/Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **updatePetWithForm**
|
||||
> updatePetWithForm($petId, $name, $status)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
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]
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **uploadFile**
|
||||
> OpenAPI\Server\Model\ApiResponse uploadFile($petId, $additionalMetadata, $file)
|
||||
|
||||
uploads an image
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?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 ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
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]
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\ApiResponse**](../Model/ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
# OpenAPI\Server\Api\StoreApiInterface
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**deleteOrder**](StoreApiInterface.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
[**getInventory**](StoreApiInterface.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getOrderById**](StoreApiInterface.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
[**placeOrder**](StoreApiInterface.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
|
||||
## Service Declaration
|
||||
```yaml
|
||||
# config/services.yaml
|
||||
services:
|
||||
# ...
|
||||
Acme\MyBundle\Api\StoreApi:
|
||||
tags:
|
||||
- { name: "open_api_server.api", api: "store" }
|
||||
# ...
|
||||
```
|
||||
|
||||
## **deleteOrder**
|
||||
> deleteOrder($orderId)
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/StoreApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\StoreApiInterface;
|
||||
|
||||
class StoreApi implements StoreApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of StoreApiInterface#deleteOrder
|
||||
*/
|
||||
public function deleteOrder(string $orderId, int &$responseCode, array &$responseHeaders): void
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **string**| ID of the order that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **getInventory**
|
||||
> int getInventory()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/StoreApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\StoreApiInterface;
|
||||
|
||||
class StoreApi implements StoreApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure API key authorization: api_key
|
||||
*/
|
||||
public function setapi_key($apiKey)
|
||||
{
|
||||
// Retrieve logged in user from $apiKey ...
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of StoreApiInterface#getInventory
|
||||
*/
|
||||
public function getInventory(int &$responseCode, array &$responseHeaders): array|object|null
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**int**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **getOrderById**
|
||||
> OpenAPI\Server\Model\Order getOrderById($orderId)
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/StoreApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\StoreApiInterface;
|
||||
|
||||
class StoreApi implements StoreApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of StoreApiInterface#getOrderById
|
||||
*/
|
||||
public function getOrderById(int $orderId, int &$responseCode, array &$responseHeaders): array|object|null
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\Order**](../Model/Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **placeOrder**
|
||||
> OpenAPI\Server\Model\Order placeOrder($order)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/StoreApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\StoreApiInterface;
|
||||
|
||||
class StoreApi implements StoreApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of StoreApiInterface#placeOrder
|
||||
*/
|
||||
public function placeOrder(Order $order, int &$responseCode, array &$responseHeaders): array|object|null
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order** | [**OpenAPI\Server\Model\Order**](../Model/Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\Order**](../Model/Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
@@ -0,0 +1,506 @@
|
||||
# OpenAPI\Server\Api\UserApiInterface
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**createUser**](UserApiInterface.md#createUser) | **POST** /user | Create user
|
||||
[**createUsersWithArrayInput**](UserApiInterface.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
[**createUsersWithListInput**](UserApiInterface.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
[**deleteUser**](UserApiInterface.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
[**getUserByName**](UserApiInterface.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**loginUser**](UserApiInterface.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**logoutUser**](UserApiInterface.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**updateUser**](UserApiInterface.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
## Service Declaration
|
||||
```yaml
|
||||
# config/services.yaml
|
||||
services:
|
||||
# ...
|
||||
Acme\MyBundle\Api\UserApi:
|
||||
tags:
|
||||
- { name: "open_api_server.api", api: "user" }
|
||||
# ...
|
||||
```
|
||||
|
||||
## **createUser**
|
||||
> createUser($user)
|
||||
|
||||
Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure API key authorization: api_key
|
||||
*/
|
||||
public function setapi_key($apiKey)
|
||||
{
|
||||
// Retrieve logged in user from $apiKey ...
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#createUser
|
||||
*/
|
||||
public function createUser(User $user, int &$responseCode, array &$responseHeaders): void
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **createUsersWithArrayInput**
|
||||
> createUsersWithArrayInput($user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure API key authorization: api_key
|
||||
*/
|
||||
public function setapi_key($apiKey)
|
||||
{
|
||||
// Retrieve logged in user from $apiKey ...
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#createUsersWithArrayInput
|
||||
*/
|
||||
public function createUsersWithArrayInput(array $user, int &$responseCode, array &$responseHeaders): void
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **createUsersWithListInput**
|
||||
> createUsersWithListInput($user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure API key authorization: api_key
|
||||
*/
|
||||
public function setapi_key($apiKey)
|
||||
{
|
||||
// Retrieve logged in user from $apiKey ...
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#createUsersWithListInput
|
||||
*/
|
||||
public function createUsersWithListInput(array $user, int &$responseCode, array &$responseHeaders): void
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **deleteUser**
|
||||
> deleteUser($username)
|
||||
|
||||
Delete user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure API key authorization: api_key
|
||||
*/
|
||||
public function setapi_key($apiKey)
|
||||
{
|
||||
// Retrieve logged in user from $apiKey ...
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#deleteUser
|
||||
*/
|
||||
public function deleteUser(string $username, int &$responseCode, array &$responseHeaders): void
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| The name that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **getUserByName**
|
||||
> OpenAPI\Server\Model\User getUserByName($username)
|
||||
|
||||
Get user by user name
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#getUserByName
|
||||
*/
|
||||
public function getUserByName(string $username, int &$responseCode, array &$responseHeaders): array|object|null
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| The name that needs to be fetched. Use user1 for testing. |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OpenAPI\Server\Model\User**](../Model/User.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **loginUser**
|
||||
> string loginUser($username, $password)
|
||||
|
||||
Logs user into the system
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#loginUser
|
||||
*/
|
||||
public function loginUser(string $username, string $password, int &$responseCode, array &$responseHeaders): array|object|null
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| The user name for login |
|
||||
**password** | **string**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **logoutUser**
|
||||
> logoutUser()
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure API key authorization: api_key
|
||||
*/
|
||||
public function setapi_key($apiKey)
|
||||
{
|
||||
// Retrieve logged in user from $apiKey ...
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#logoutUser
|
||||
*/
|
||||
public function logoutUser(int &$responseCode, array &$responseHeaders): void
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
## **updateUser**
|
||||
> updateUser($username, $user)
|
||||
|
||||
Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use OpenAPI\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure API key authorization: api_key
|
||||
*/
|
||||
public function setapi_key($apiKey)
|
||||
{
|
||||
// Retrieve logged in user from $apiKey ...
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#updateUser
|
||||
*/
|
||||
public function updateUser(string $username, User $user, int &$responseCode, array &$responseHeaders): void
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| name that need to be deleted |
|
||||
**user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | | [optional]
|
||||
**type** | **string** | | [optional]
|
||||
**message** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Category
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**name** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Order
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**petId** | **int** | | [optional]
|
||||
**quantity** | **int** | | [optional]
|
||||
**shipDate** | **\DateTime** | | [optional]
|
||||
**status** | **string** | Order Status | [optional]
|
||||
**complete** | **bool** | | [optional] [default to false]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Pet
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**category** | [**OpenAPI\Server\Model\Category**](Category.md) | | [optional]
|
||||
**name** | **string** | |
|
||||
**photoUrls** | **string** | |
|
||||
**tags** | [**OpenAPI\Server\Model\Tag**](Tag.md) | | [optional]
|
||||
**status** | **string** | pet status in the store | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Tag
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**name** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# User
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**username** | **string** | | [optional]
|
||||
**firstName** | **string** | | [optional]
|
||||
**lastName** | **string** | | [optional]
|
||||
**email** | **string** | | [optional]
|
||||
**password** | **string** | | [optional]
|
||||
**phone** | **string** | | [optional]
|
||||
**userStatus** | **int** | User Status | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user