Fix PHP Symfony OpenAPI 3 sample location. Fixes #3531 (#3532)

* Fix PHP Symfony OpenAPI 3.0 sample location

* Update PHP Symfony OpenAPI 3.0 sample
This commit is contained in:
Ivan Aksamentov
2019-08-02 00:55:58 +02:00
committed by William Cheng
parent 581131e0fe
commit ed82aaae97
63 changed files with 8105 additions and 1 deletions

View File

@@ -0,0 +1,80 @@
<?php
/**
* ApiServer
*
* PHP version 5
*
* @category Class
* @package OpenAPI\Server\Api
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Do not edit the class manually.
*/
namespace OpenAPI\Server\Api;
/**
* ApiServer Class Doc Comment
*
* PHP version 5
*
* @category Class
* @package OpenAPI\Server\Api
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
class ApiServer
{
/**
* @var array
*/
private $apis = array();
/**
* Adds an API handler to the server.
*
* @param string $api An API name of the handle
* @param mixed $handler A handler to set for the given API
*/
public function addApiHandler($api, $handler)
{
if (isset($this->apis[$api])) {
throw new \InvalidArgumentException('API has already a handler: '.$api);
}
$this->apis[$api] = $handler;
}
/**
* Returns an API handler.
*
* @param string $api An API name of the handle
* @return mixed Returns a handler
* @throws \InvalidArgumentException When no such handler exists
*/
public function getApiHandler($api)
{
if (!isset($this->apis[$api])) {
throw new \InvalidArgumentException('No handler for '.$api.' implemented.');
}
return $this->apis[$api];
}
}

View File

@@ -0,0 +1,190 @@
<?php
/**
* PetApiInterface
* PHP version 5
*
* @category Class
* @package OpenAPI\Server
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Do not edit the class manually.
*/
namespace OpenAPI\Server\Api;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use OpenAPI\Server\Model\ApiResponse;
use OpenAPI\Server\Model\Pet;
/**
* PetApiInterface Interface Doc Comment
*
* @category Interface
* @package OpenAPI\Server\Api
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
interface PetApiInterface
{
/**
* Sets authentication method petstore_auth
*
* @param string $value Value of the petstore_auth authentication method.
*
* @return void
*/
public function setpetstore_auth($value);
/**
* Sets authentication method api_key
*
* @param string $value Value of the api_key authentication method.
*
* @return void
*/
public function setapi_key($value);
/**
* Sets authentication method petstore_auth
*
* @param string $value Value of the petstore_auth authentication method.
*
* @return void
*/
public function setpetstore_auth($value);
/**
* Operation addPet
*
* Add a new pet to the store
*
* @param OpenAPI\Server\Model\Pet $pet Pet object that needs to be added to the store (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function addPet(Pet $pet, &$responseCode, array &$responseHeaders);
/**
* Operation deletePet
*
* Deletes a pet
*
* @param int $petId Pet id to delete (required)
* @param string $apiKey (optional)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function deletePet($petId, $apiKey = null, &$responseCode, array &$responseHeaders);
/**
* Operation findPetsByStatus
*
* Finds Pets by status
*
* @param string[] $status Status values that need to be considered for filter (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return OpenAPI\Server\Model\Pet[]
*
*/
public function findPetsByStatus(array $status, &$responseCode, array &$responseHeaders);
/**
* Operation findPetsByTags
*
* Finds Pets by tags
*
* @param string[] $tags Tags to filter by (required)
* @param int $maxCount Maximum number of items to return (optional)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return OpenAPI\Server\Model\Pet[]
*
*/
public function findPetsByTags(array $tags, $maxCount = null, &$responseCode, array &$responseHeaders);
/**
* Operation getPetById
*
* Find pet by ID
*
* @param int $petId ID of pet to return (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return OpenAPI\Server\Model\Pet
*
*/
public function getPetById($petId, &$responseCode, array &$responseHeaders);
/**
* Operation updatePet
*
* Update an existing pet
*
* @param OpenAPI\Server\Model\Pet $pet Pet object that needs to be added to the store (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function updatePet(Pet $pet, &$responseCode, array &$responseHeaders);
/**
* Operation updatePetWithForm
*
* Updates a pet in the store with form data
*
* @param int $petId ID of pet that needs to be updated (required)
* @param string $name Updated name of the pet (optional)
* @param string $status Updated status of the pet (optional)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function updatePetWithForm($petId, $name = null, $status = null, &$responseCode, array &$responseHeaders);
/**
* Operation uploadFile
*
* uploads an image
*
* @param int $petId ID of pet to update (required)
* @param string $additionalMetadata Additional data to pass to server (optional)
* @param UploadedFile $file file to upload (optional)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return OpenAPI\Server\Model\ApiResponse
*
*/
public function uploadFile($petId, $additionalMetadata = null, UploadedFile $file = null, &$responseCode, array &$responseHeaders);
}

View File

@@ -0,0 +1,108 @@
<?php
/**
* StoreApiInterface
* PHP version 5
*
* @category Class
* @package OpenAPI\Server
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Do not edit the class manually.
*/
namespace OpenAPI\Server\Api;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use OpenAPI\Server\Model\Order;
/**
* StoreApiInterface Interface Doc Comment
*
* @category Interface
* @package OpenAPI\Server\Api
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
interface StoreApiInterface
{
/**
* Sets authentication method api_key
*
* @param string $value Value of the api_key authentication method.
*
* @return void
*/
public function setapi_key($value);
/**
* Operation deleteOrder
*
* Delete purchase order by ID
*
* @param string $orderId ID of the order that needs to be deleted (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function deleteOrder($orderId, &$responseCode, array &$responseHeaders);
/**
* Operation getInventory
*
* Returns pet inventories by status
*
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return int
*
*/
public function getInventory(&$responseCode, array &$responseHeaders);
/**
* Operation getOrderById
*
* Find purchase order by ID
*
* @param int $orderId ID of pet that needs to be fetched (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return OpenAPI\Server\Model\Order
*
*/
public function getOrderById($orderId, &$responseCode, array &$responseHeaders);
/**
* Operation placeOrder
*
* Place an order for a pet
*
* @param OpenAPI\Server\Model\Order $order order placed for purchasing the pet (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return OpenAPI\Server\Model\Order
*
*/
public function placeOrder(Order $order, &$responseCode, array &$responseHeaders);
}

View File

@@ -0,0 +1,166 @@
<?php
/**
* UserApiInterface
* PHP version 5
*
* @category Class
* @package OpenAPI\Server
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Do not edit the class manually.
*/
namespace OpenAPI\Server\Api;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use OpenAPI\Server\Model\User;
/**
* UserApiInterface Interface Doc Comment
*
* @category Interface
* @package OpenAPI\Server\Api
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
interface UserApiInterface
{
/**
* Sets authentication method auth_cookie
*
* @param string $value Value of the auth_cookie authentication method.
*
* @return void
*/
public function setauth_cookie($value);
/**
* Operation createUser
*
* Create user
*
* @param OpenAPI\Server\Model\User $user Created user object (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function createUser(User $user, &$responseCode, array &$responseHeaders);
/**
* Operation createUsersWithArrayInput
*
* Creates list of users with given input array
*
* @param OpenAPI\Server\Model\User[] $user List of user object (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function createUsersWithArrayInput(array $user, &$responseCode, array &$responseHeaders);
/**
* Operation createUsersWithListInput
*
* Creates list of users with given input array
*
* @param OpenAPI\Server\Model\User[] $user List of user object (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function createUsersWithListInput(array $user, &$responseCode, array &$responseHeaders);
/**
* Operation deleteUser
*
* Delete user
*
* @param string $username The name that needs to be deleted (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function deleteUser($username, &$responseCode, array &$responseHeaders);
/**
* Operation getUserByName
*
* Get user by user name
*
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return OpenAPI\Server\Model\User
*
*/
public function getUserByName($username, &$responseCode, array &$responseHeaders);
/**
* Operation loginUser
*
* Logs user into the system
*
* @param string $username The user name for login (required)
* @param string $password The password for login in clear text (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return string
*
*/
public function loginUser($username, $password, &$responseCode, array &$responseHeaders);
/**
* Operation logoutUser
*
* Logs out current logged in user session
*
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function logoutUser(&$responseCode, array &$responseHeaders);
/**
* Operation updateUser
*
* Updated user
*
* @param string $username name that need to be deleted (required)
* @param OpenAPI\Server\Model\User $user Updated user object (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return void
*
*/
public function updateUser($username, User $user, &$responseCode, array &$responseHeaders);
}