Skip to content

Latest commit

 

History

History
506 lines (339 loc) · 11.1 KB

File metadata and controls

506 lines (339 loc) · 11.1 KB

OpenAPI\Server\Api\UserApiInterface

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

Service Declaration

# 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
// 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 Created user object

Return type

void (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createUsersWithArrayInput

createUsersWithArrayInput($user)

Creates list of users with given input array

Example Implementation

<?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 List of user object

Return type

void (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createUsersWithListInput

createUsersWithListInput($user)

Creates list of users with given input array

Example Implementation

<?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 List of user object

Return type

void (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteUser

deleteUser($username)

Delete user

This can only be done by the logged in user.

Example Implementation

<?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

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUserByName

OpenAPI\Server\Model\User getUserByName($username)

Get user by user name

Example Implementation

<?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

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

loginUser

string loginUser($username, $password)

Logs user into the system

Example Implementation

<?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): string
    {
        // 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] [Back to Model list] [Back to README]

logoutUser

logoutUser()

Logs out current logged in user session

Example Implementation

<?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

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateUser

updateUser($username, $user)

Updated user

This can only be done by the logged in user.

Example Implementation

<?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 Updated user object

Return type

void (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]