All URIs are relative to http://petstore.swagger.io/v2
| Method | HTTP request | Description |
|---|---|---|
| createUser | POST /user | Create user |
| createUsersWithArrayInput | POST /user/createWithArray | Creates list of users with given input array |
| createUsersWithListInput | POST /user/createWithList | Creates list of users with given input array |
| deleteUser | DELETE /user/{username} | Delete user |
| getUserByName | GET /user/{username} | Get user by user name |
| loginUser | GET /user/login | Logs user into the system |
| logoutUser | GET /user/logout | Logs out current logged in user session |
| updateUser | PUT /user/{username} | Updated user |
# config/services.yaml
services:
# ...
Acme\MyBundle\Api\UserApi:
tags:
- { name: "open_api_server.api", api: "user" }
# ...createUser($user)
Create user
This can only be done by the logged in user.
<?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 ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| user | OpenAPI\Server\Model\User | Created user object |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createUsersWithArrayInput($user)
Creates list of users with given input array
<?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 ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| user | OpenAPI\Server\Model\User | List of user object |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createUsersWithListInput($user)
Creates list of users with given input array
<?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 ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| user | OpenAPI\Server\Model\User | List of user object |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteUser($username)
Delete user
This can only be done by the logged in user.
<?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 ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | string | The name that needs to be deleted |
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]
OpenAPI\Server\Model\User getUserByName($username)
Get user by user name
<?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 ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | string | The name that needs to be fetched. Use user1 for testing. |
No authorization required
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string loginUser($username, $password)
Logs user into the system
<?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 ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | string | The user name for login | |
| password | string | The password for login in clear text |
string
No authorization required
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
logoutUser()
Logs out current logged in user session
<?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 ...
}
// ...
}This endpoint does not need any parameter.
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]
updateUser($username, $user)
Updated user
This can only be done by the logged in user.
<?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 ...
}
// ...
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | string | name that need to be deleted | |
| user | OpenAPI\Server\Model\User | Updated user object |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]