forked from loafle/openapi-generator-original
[PHP][Symfony] Enhancements (#6615)
* Removed commented code * Input validation is now supported as strict JSON validation * [PHP][Symfony] Improve the implementation Closes #6614 * Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer * Updated shell script because shippable tests were failing
This commit is contained in:
@@ -0,0 +1,529 @@
|
||||
# Swagger\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
|
||||
# src/Acme/MyBundle/Resources/services.yml
|
||||
services:
|
||||
# ...
|
||||
acme.my_bundle.api.pet:
|
||||
class: Acme\MyBundle\Api\PetApi
|
||||
tags:
|
||||
- { name: "swagger_server.api", api: "pet" }
|
||||
# ...
|
||||
```
|
||||
|
||||
## **addPet**
|
||||
> addPet($body)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/PetApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use Swagger\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 $body)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Swagger\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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 Swagger\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($petId, $apiKey = null)
|
||||
{
|
||||
// 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**: 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)
|
||||
|
||||
## **findPetsByStatus**
|
||||
> Swagger\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 Swagger\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)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**string[]**](../Model/string.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Swagger\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**
|
||||
> Swagger\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 Swagger\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)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**string[]**](../Model/string.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Swagger\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**
|
||||
> Swagger\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 Swagger\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($petId)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **int**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Swagger\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**
|
||||
> updatePet($body)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/PetApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use Swagger\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 $body)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Swagger\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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 Swagger\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($petId, $name = null, $status = null)
|
||||
{
|
||||
// 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**: 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)
|
||||
|
||||
## **uploadFile**
|
||||
> Swagger\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 Swagger\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($petId, $additionalMetadata = null, UploadedFile $file = 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**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Swagger\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,245 @@
|
||||
# Swagger\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
|
||||
# src/Acme/MyBundle/Resources/services.yml
|
||||
services:
|
||||
# ...
|
||||
acme.my_bundle.api.store:
|
||||
class: Acme\MyBundle\Api\StoreApi
|
||||
tags:
|
||||
- { name: "swagger_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 Swagger\Server\Api\StoreApiInterface;
|
||||
|
||||
class StoreApi implements StoreApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of StoreApiInterface#deleteOrder
|
||||
*/
|
||||
public function deleteOrder($orderId)
|
||||
{
|
||||
// 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**: 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)
|
||||
|
||||
## **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 Swagger\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()
|
||||
{
|
||||
// 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**
|
||||
> Swagger\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 Swagger\Server\Api\StoreApiInterface;
|
||||
|
||||
class StoreApi implements StoreApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of StoreApiInterface#getOrderById
|
||||
*/
|
||||
public function getOrderById($orderId)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **int**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Swagger\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**
|
||||
> Swagger\Server\Model\Order placeOrder($body)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/StoreApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use Swagger\Server\Api\StoreApiInterface;
|
||||
|
||||
class StoreApi implements StoreApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of StoreApiInterface#placeOrder
|
||||
*/
|
||||
public function placeOrder(Order $body)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Swagger\Server\Model\Order**](../Model/Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Swagger\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)
|
||||
|
||||
@@ -0,0 +1,459 @@
|
||||
# Swagger\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
|
||||
# src/Acme/MyBundle/Resources/services.yml
|
||||
services:
|
||||
# ...
|
||||
acme.my_bundle.api.user:
|
||||
class: Acme\MyBundle\Api\UserApi
|
||||
tags:
|
||||
- { name: "swagger_server.api", api: "user" }
|
||||
# ...
|
||||
```
|
||||
|
||||
## **createUser**
|
||||
> createUser($body)
|
||||
|
||||
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 Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#createUser
|
||||
*/
|
||||
public function createUser(User $body)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Swagger\Server\Model\User**](../Model/User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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)
|
||||
|
||||
## **createUsersWithArrayInput**
|
||||
> createUsersWithArrayInput($body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#createUsersWithArrayInput
|
||||
*/
|
||||
public function createUsersWithArrayInput(array $body)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Swagger\Server\Model\User[]**](../Model/User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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)
|
||||
|
||||
## **createUsersWithListInput**
|
||||
> createUsersWithListInput($body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example Implementation
|
||||
```php
|
||||
<?php
|
||||
// src/Acme/MyBundle/Api/UserApiInterface.php
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#createUsersWithListInput
|
||||
*/
|
||||
public function createUsersWithListInput(array $body)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Swagger\Server\Model\User[]**](../Model/User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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)
|
||||
|
||||
## **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 Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#deleteUser
|
||||
*/
|
||||
public function deleteUser($username)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| The name that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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)
|
||||
|
||||
## **getUserByName**
|
||||
> Swagger\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 Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#getUserByName
|
||||
*/
|
||||
public function getUserByName($username)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| The name that needs to be fetched. Use user1 for testing. |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Swagger\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 Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#loginUser
|
||||
*/
|
||||
public function loginUser($username, $password)
|
||||
{
|
||||
// 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 Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#logoutUser
|
||||
*/
|
||||
public function logoutUser()
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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)
|
||||
|
||||
## **updateUser**
|
||||
> updateUser($username, $body)
|
||||
|
||||
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 Swagger\Server\Api\UserApiInterface;
|
||||
|
||||
class UserApi implements UserApiInterface
|
||||
{
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Implementation of UserApiInterface#updateUser
|
||||
*/
|
||||
public function updateUser($username, User $body)
|
||||
{
|
||||
// Implement the operation ...
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **string**| name that need to be deleted |
|
||||
**body** | [**Swagger\Server\Model\User**](../Model/User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### 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)
|
||||
|
||||
@@ -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**](\DateTime.md) | | [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** | [**Swagger\Server\Model\Category**](Category.md) | | [optional]
|
||||
**name** | **string** | |
|
||||
**photoUrls** | **string[]** | |
|
||||
**tags** | [**Swagger\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