forked from loafle/openapi-generator-original
minor fixes (#5981)
* Update configuration.mustache added return tag in PHPDoc * made sanitizeFilename as static method * updated petstore
This commit is contained in:
@@ -78,7 +78,7 @@ class ObjectSerializer
|
|||||||
*
|
*
|
||||||
* @return string the sanitized filename
|
* @return string the sanitized filename
|
||||||
*/
|
*/
|
||||||
public function sanitizeFilename($filename)
|
public static function sanitizeFilename($filename)
|
||||||
{
|
{
|
||||||
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
|
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
|
||||||
return $match[1];
|
return $match[1];
|
||||||
@@ -257,7 +257,7 @@ class ObjectSerializer
|
|||||||
// determine file name
|
// determine file name
|
||||||
if (array_key_exists('Content-Disposition', $httpHeaders) &&
|
if (array_key_exists('Content-Disposition', $httpHeaders) &&
|
||||||
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
||||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . sanitizeFilename($match[1]);
|
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]);
|
||||||
} else {
|
} else {
|
||||||
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -445,6 +445,8 @@ class Configuration
|
|||||||
/**
|
/**
|
||||||
* Set whether to accept encoding
|
* Set whether to accept encoding
|
||||||
* @param bool $allowEncoding
|
* @param bool $allowEncoding
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setAllowEncoding($allowEncoding)
|
public function setAllowEncoding($allowEncoding)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# SwaggerClient-php
|
# SwaggerClient-php
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
@@ -56,14 +56,16 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\FakeApi();
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
$body = new \Swagger\Client\Model\OuterBoolean(); // \Swagger\Client\Model\OuterBoolean | Input boolean as post body
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
|
$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $api_instance->fakeOuterBooleanSerialize($body);
|
$api_instance->addPet($body);
|
||||||
print_r($result);
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL;
|
echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -71,17 +73,10 @@ try {
|
|||||||
|
|
||||||
## Documentation for API Endpoints
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
|
||||||
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
|
||||||
*FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
|
|
||||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/Api/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
|
|
||||||
*FakeApi* | [**testClientModel**](docs/Api/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
|
|
||||||
*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
|
||||||
*FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
|
|
||||||
*PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
*PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||||
*PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
*PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
*PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
*PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
@@ -90,9 +85,9 @@ Class | Method | HTTP request | Description
|
|||||||
*PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
*PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||||
*PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
*PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
*PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
*PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
*StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
*StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
|
*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
*StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
*StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||||
*UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user
|
*UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user
|
||||||
*UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
*UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
@@ -106,42 +101,12 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
## Documentation For Models
|
## Documentation For Models
|
||||||
|
|
||||||
- [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md)
|
|
||||||
- [Animal](docs/Model/Animal.md)
|
|
||||||
- [AnimalFarm](docs/Model/AnimalFarm.md)
|
|
||||||
- [ApiResponse](docs/Model/ApiResponse.md)
|
- [ApiResponse](docs/Model/ApiResponse.md)
|
||||||
- [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md)
|
|
||||||
- [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md)
|
|
||||||
- [ArrayTest](docs/Model/ArrayTest.md)
|
|
||||||
- [Capitalization](docs/Model/Capitalization.md)
|
|
||||||
- [Category](docs/Model/Category.md)
|
- [Category](docs/Model/Category.md)
|
||||||
- [ClassModel](docs/Model/ClassModel.md)
|
|
||||||
- [Client](docs/Model/Client.md)
|
|
||||||
- [EnumArrays](docs/Model/EnumArrays.md)
|
|
||||||
- [EnumClass](docs/Model/EnumClass.md)
|
|
||||||
- [EnumTest](docs/Model/EnumTest.md)
|
|
||||||
- [FormatTest](docs/Model/FormatTest.md)
|
|
||||||
- [HasOnlyReadOnly](docs/Model/HasOnlyReadOnly.md)
|
|
||||||
- [MapTest](docs/Model/MapTest.md)
|
|
||||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md)
|
|
||||||
- [Model200Response](docs/Model/Model200Response.md)
|
|
||||||
- [ModelList](docs/Model/ModelList.md)
|
|
||||||
- [ModelReturn](docs/Model/ModelReturn.md)
|
|
||||||
- [Name](docs/Model/Name.md)
|
|
||||||
- [NumberOnly](docs/Model/NumberOnly.md)
|
|
||||||
- [Order](docs/Model/Order.md)
|
- [Order](docs/Model/Order.md)
|
||||||
- [OuterBoolean](docs/Model/OuterBoolean.md)
|
|
||||||
- [OuterComposite](docs/Model/OuterComposite.md)
|
|
||||||
- [OuterEnum](docs/Model/OuterEnum.md)
|
|
||||||
- [OuterNumber](docs/Model/OuterNumber.md)
|
|
||||||
- [OuterString](docs/Model/OuterString.md)
|
|
||||||
- [Pet](docs/Model/Pet.md)
|
- [Pet](docs/Model/Pet.md)
|
||||||
- [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md)
|
|
||||||
- [SpecialModelName](docs/Model/SpecialModelName.md)
|
|
||||||
- [Tag](docs/Model/Tag.md)
|
- [Tag](docs/Model/Tag.md)
|
||||||
- [User](docs/Model/User.md)
|
- [User](docs/Model/User.md)
|
||||||
- [Cat](docs/Model/Cat.md)
|
|
||||||
- [Dog](docs/Model/Dog.md)
|
|
||||||
|
|
||||||
|
|
||||||
## Documentation For Authorization
|
## Documentation For Authorization
|
||||||
@@ -153,10 +118,6 @@ Class | Method | HTTP request | Description
|
|||||||
- **API key parameter name**: api_key
|
- **API key parameter name**: api_key
|
||||||
- **Location**: HTTP header
|
- **Location**: HTTP header
|
||||||
|
|
||||||
## http_basic_test
|
|
||||||
|
|
||||||
- **Type**: HTTP basic authentication
|
|
||||||
|
|
||||||
## petstore_auth
|
## petstore_auth
|
||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Swagger\Client\PetApi
|
# Swagger\Client\PetApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Swagger\Client\StoreApi
|
# Swagger\Client\StoreApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Swagger\Client\UserApi
|
# Swagger\Client\UserApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -118,7 +118,7 @@ class StoreApi
|
|||||||
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
|
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
|
||||||
}
|
}
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/store/order/{order_id}";
|
$resourcePath = "/store/order/{orderId}";
|
||||||
$httpBody = '';
|
$httpBody = '';
|
||||||
$queryParams = [];
|
$queryParams = [];
|
||||||
$headerParams = [];
|
$headerParams = [];
|
||||||
@@ -132,7 +132,7 @@ class StoreApi
|
|||||||
// path params
|
// path params
|
||||||
if ($order_id !== null) {
|
if ($order_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "order_id" . "}",
|
"{" . "orderId" . "}",
|
||||||
$this->apiClient->getSerializer()->toPathValue($order_id),
|
$this->apiClient->getSerializer()->toPathValue($order_id),
|
||||||
$resourcePath
|
$resourcePath
|
||||||
);
|
);
|
||||||
@@ -153,7 +153,7 @@ class StoreApi
|
|||||||
$httpBody,
|
$httpBody,
|
||||||
$headerParams,
|
$headerParams,
|
||||||
null,
|
null,
|
||||||
'/store/order/{order_id}'
|
'/store/order/{orderId}'
|
||||||
);
|
);
|
||||||
|
|
||||||
return [null, $statusCode, $httpHeader];
|
return [null, $statusCode, $httpHeader];
|
||||||
@@ -276,7 +276,7 @@ class StoreApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/store/order/{order_id}";
|
$resourcePath = "/store/order/{orderId}";
|
||||||
$httpBody = '';
|
$httpBody = '';
|
||||||
$queryParams = [];
|
$queryParams = [];
|
||||||
$headerParams = [];
|
$headerParams = [];
|
||||||
@@ -290,7 +290,7 @@ class StoreApi
|
|||||||
// path params
|
// path params
|
||||||
if ($order_id !== null) {
|
if ($order_id !== null) {
|
||||||
$resourcePath = str_replace(
|
$resourcePath = str_replace(
|
||||||
"{" . "order_id" . "}",
|
"{" . "orderId" . "}",
|
||||||
$this->apiClient->getSerializer()->toPathValue($order_id),
|
$this->apiClient->getSerializer()->toPathValue($order_id),
|
||||||
$resourcePath
|
$resourcePath
|
||||||
);
|
);
|
||||||
@@ -311,7 +311,7 @@ class StoreApi
|
|||||||
$httpBody,
|
$httpBody,
|
||||||
$headerParams,
|
$headerParams,
|
||||||
'\Swagger\Client\Model\Order',
|
'\Swagger\Client\Model\Order',
|
||||||
'/store/order/{order_id}'
|
'/store/order/{orderId}'
|
||||||
);
|
);
|
||||||
|
|
||||||
return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader];
|
return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader];
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -88,7 +88,7 @@ class Configuration
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $host = 'http://petstore.swagger.io:80/v2';
|
protected $host = 'http://petstore.swagger.io/v2';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timeout (second) of the HTTP request, by default set to 0, no timeout
|
* Timeout (second) of the HTTP request, by default set to 0, no timeout
|
||||||
@@ -455,6 +455,8 @@ class Configuration
|
|||||||
/**
|
/**
|
||||||
* Set whether to accept encoding
|
* Set whether to accept encoding
|
||||||
* @param bool $allowEncoding
|
* @param bool $allowEncoding
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setAllowEncoding($allowEncoding)
|
public function setAllowEncoding($allowEncoding)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -35,6 +35,7 @@ use \ArrayAccess;
|
|||||||
* ApiResponse Class Doc Comment
|
* ApiResponse Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
|
* @description Describes the result of uploading an image resource
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author Swagger Codegen team
|
* @author Swagger Codegen team
|
||||||
* @link https://github.com/swagger-api/swagger-codegen
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -35,6 +35,7 @@ use \ArrayAccess;
|
|||||||
* Category Class Doc Comment
|
* Category Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
|
* @description A category for a pet
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author Swagger Codegen team
|
* @author Swagger Codegen team
|
||||||
* @link https://github.com/swagger-api/swagger-codegen
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -35,6 +35,7 @@ use \ArrayAccess;
|
|||||||
* Order Class Doc Comment
|
* Order Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
|
* @description An order for a pets from the pet store
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author Swagger Codegen team
|
* @author Swagger Codegen team
|
||||||
* @link https://github.com/swagger-api/swagger-codegen
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -35,6 +35,7 @@ use \ArrayAccess;
|
|||||||
* Pet Class Doc Comment
|
* Pet Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
|
* @description A pet for sale in the pet store
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author Swagger Codegen team
|
* @author Swagger Codegen team
|
||||||
* @link https://github.com/swagger-api/swagger-codegen
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -35,6 +35,7 @@ use \ArrayAccess;
|
|||||||
* Tag Class Doc Comment
|
* Tag Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
|
* @description A tag for a pet
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author Swagger Codegen team
|
* @author Swagger Codegen team
|
||||||
* @link https://github.com/swagger-api/swagger-codegen
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -35,6 +35,7 @@ use \ArrayAccess;
|
|||||||
* User Class Doc Comment
|
* User Class Doc Comment
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
|
* @description A User who is purchasing from the pet store
|
||||||
* @package Swagger\Client
|
* @package Swagger\Client
|
||||||
* @author Swagger Codegen team
|
* @author Swagger Codegen team
|
||||||
* @link https://github.com/swagger-api/swagger-codegen
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/**
|
/**
|
||||||
* Swagger Petstore
|
* Swagger Petstore
|
||||||
*
|
*
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
* Contact: apiteam@swagger.io
|
||||||
@@ -88,7 +88,7 @@ class ObjectSerializer
|
|||||||
*
|
*
|
||||||
* @return string the sanitized filename
|
* @return string the sanitized filename
|
||||||
*/
|
*/
|
||||||
public function sanitizeFilename($filename)
|
public static function sanitizeFilename($filename)
|
||||||
{
|
{
|
||||||
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
|
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
|
||||||
return $match[1];
|
return $match[1];
|
||||||
@@ -267,7 +267,7 @@ class ObjectSerializer
|
|||||||
// determine file name
|
// determine file name
|
||||||
if (array_key_exists('Content-Disposition', $httpHeaders) &&
|
if (array_key_exists('Content-Disposition', $httpHeaders) &&
|
||||||
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
|
||||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . sanitizeFilename($match[1]);
|
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]);
|
||||||
} else {
|
} else {
|
||||||
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||||
<directory suffix=".php">./lib/Api</directory>
|
<directory suffix=".php">./lib\Api</directory>
|
||||||
<directory suffix=".php">./lib/Model</directory>
|
<directory suffix=".php">./lib\Model</directory>
|
||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
Reference in New Issue
Block a user