forked from loafle/openapi-generator-original
Regenerate 'samples/client/petstore-security-test/php/' (#368)
Using 'bin/security/php-petstore.sh'
This commit is contained in:
committed by
William Cheng
parent
059a3efe46
commit
58c45b9b75
@@ -1,10 +1,10 @@
|
||||
# SwaggerClient-php
|
||||
# OpenAPIToolsClient-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: \" \\ *_/ ' \" =end --
|
||||
|
||||
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 [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
- Build package: io.swagger.codegen.languages.PhpClientCodegen
|
||||
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -36,7 +36,7 @@ Then run `composer install`
|
||||
Download the files and include `autoload.php`:
|
||||
|
||||
```php
|
||||
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
|
||||
require_once('/path/to/OpenAPIToolsClient-php/vendor/autoload.php');
|
||||
```
|
||||
|
||||
## Tests
|
||||
@@ -56,15 +56,15 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\FakeApi(
|
||||
$apiInstance = new OpenAPITools\Client\Api\FakeApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$test_code_inject____end____rn_n_r = "test_code_inject____end____rn_n_r_example"; // string | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
$unknown_base_type = new \OpenAPITools\Client\Model\UNKNOWN_BASE_TYPE(); // object |
|
||||
|
||||
try {
|
||||
$apiInstance->testCodeInjectEndRnNR($test_code_inject____end____rn_n_r);
|
||||
$apiInstance->testCodeInjectEndRnNR($unknown_base_type);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ try {
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||
All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
@@ -107,6 +107,6 @@ Class | Method | HTTP request | Description
|
||||
|
||||
## Author
|
||||
|
||||
apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
"name": "GIT_USER_ID/GIT_REPO_ID",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"swagger",
|
||||
"openapitools",
|
||||
"php",
|
||||
"sdk",
|
||||
"api"
|
||||
],
|
||||
"homepage": "http://swagger.io",
|
||||
"homepage": "http://openapi-generator.tech",
|
||||
"license": "proprietary",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Swagger and contributors",
|
||||
"homepage": "https://github.com/swagger-api/swagger-codegen"
|
||||
"name": "OpenAPI-Generator contributors",
|
||||
"homepage": "https://openapi-generator.tech"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
@@ -28,9 +28,9 @@
|
||||
"friendsofphp/php-cs-fixer": "~1.12"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Swagger\\Client\\" : "lib/" }
|
||||
"psr-4": { "OpenAPITools\\Client\\" : "lib/" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "Swagger\\Client\\" : "test/" }
|
||||
"psr-4": { "OpenAPITools\\Client\\" : "test/" }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
# Swagger\Client\FakeApi
|
||||
# OpenAPITools\Client\FakeApi
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||
All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@@ -8,7 +8,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **testCodeInjectEndRnNR**
|
||||
> testCodeInjectEndRnNR($test_code_inject____end____rn_n_r)
|
||||
> testCodeInjectEndRnNR($unknown_base_type)
|
||||
|
||||
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
|
||||
@@ -17,15 +17,15 @@ To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$apiInstance = new Swagger\Client\Api\FakeApi(
|
||||
$apiInstance = new OpenAPITools\Client\Api\FakeApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$test_code_inject____end____rn_n_r = "test_code_inject____end____rn_n_r_example"; // string | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
$unknown_base_type = new \OpenAPITools\Client\Model\UNKNOWN_BASE_TYPE(); // object |
|
||||
|
||||
try {
|
||||
$apiInstance->testCodeInjectEndRnNR($test_code_inject____end____rn_n_r);
|
||||
$apiInstance->testCodeInjectEndRnNR($unknown_base_type);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**test_code_inject____end____rn_n_r** | **string**| To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | [optional]
|
||||
**unknown_base_type** | [**object**](../Model/UNKNOWN_BASE_TYPE.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -49,7 +49,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, *_/ \" =end --
|
||||
- **Accept**: application/json, *_/ \" =end --
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
@@ -4,29 +4,29 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Api;
|
||||
namespace OpenAPITools\Client\Api;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
@@ -34,18 +34,18 @@ use GuzzleHttp\Exception\RequestException;
|
||||
use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use Swagger\Client\ApiException;
|
||||
use Swagger\Client\Configuration;
|
||||
use Swagger\Client\HeaderSelector;
|
||||
use Swagger\Client\ObjectSerializer;
|
||||
use OpenAPITools\Client\ApiException;
|
||||
use OpenAPITools\Client\Configuration;
|
||||
use OpenAPITools\Client\HeaderSelector;
|
||||
use OpenAPITools\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* FakeApi Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class FakeApi
|
||||
{
|
||||
@@ -92,15 +92,15 @@ class FakeApi
|
||||
*
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||
* @param object $unknown_base_type unknown_base_type (optional)
|
||||
*
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
* @throws \OpenAPITools\Client\ApiException on non-2xx response
|
||||
* @throws \InvalidArgumentException
|
||||
* @return void
|
||||
*/
|
||||
public function testCodeInjectEndRnNR($test_code_inject____end____rn_n_r = null)
|
||||
public function testCodeInjectEndRnNR($unknown_base_type = null)
|
||||
{
|
||||
$this->testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn_n_r);
|
||||
$this->testCodeInjectEndRnNRWithHttpInfo($unknown_base_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,16 +108,16 @@ class FakeApi
|
||||
*
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||
* @param object $unknown_base_type (optional)
|
||||
*
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
* @throws \OpenAPITools\Client\ApiException on non-2xx response
|
||||
* @throws \InvalidArgumentException
|
||||
* @return array of null, HTTP status code, HTTP response headers (array of strings)
|
||||
*/
|
||||
public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn_n_r = null)
|
||||
public function testCodeInjectEndRnNRWithHttpInfo($unknown_base_type = null)
|
||||
{
|
||||
$returnType = '';
|
||||
$request = $this->testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n_r);
|
||||
$request = $this->testCodeInjectEndRnNRRequest($unknown_base_type);
|
||||
|
||||
try {
|
||||
$options = $this->createHttpClientOption();
|
||||
@@ -161,14 +161,14 @@ class FakeApi
|
||||
*
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||
* @param object $unknown_base_type (optional)
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||
*/
|
||||
public function testCodeInjectEndRnNRAsync($test_code_inject____end____rn_n_r = null)
|
||||
public function testCodeInjectEndRnNRAsync($unknown_base_type = null)
|
||||
{
|
||||
return $this->testCodeInjectEndRnNRAsyncWithHttpInfo($test_code_inject____end____rn_n_r)
|
||||
return $this->testCodeInjectEndRnNRAsyncWithHttpInfo($unknown_base_type)
|
||||
->then(
|
||||
function ($response) {
|
||||
return $response[0];
|
||||
@@ -181,15 +181,15 @@ class FakeApi
|
||||
*
|
||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||
* @param object $unknown_base_type (optional)
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Promise\PromiseInterface
|
||||
*/
|
||||
public function testCodeInjectEndRnNRAsyncWithHttpInfo($test_code_inject____end____rn_n_r = null)
|
||||
public function testCodeInjectEndRnNRAsyncWithHttpInfo($unknown_base_type = null)
|
||||
{
|
||||
$returnType = '';
|
||||
$request = $this->testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n_r);
|
||||
$request = $this->testCodeInjectEndRnNRRequest($unknown_base_type);
|
||||
|
||||
return $this->client
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
@@ -217,12 +217,12 @@ class FakeApi
|
||||
/**
|
||||
* Create request for operation 'testCodeInjectEndRnNR'
|
||||
*
|
||||
* @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||
* @param object $unknown_base_type (optional)
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return \GuzzleHttp\Psr7\Request
|
||||
*/
|
||||
protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n_r = null)
|
||||
protected function testCodeInjectEndRnNRRequest($unknown_base_type = null)
|
||||
{
|
||||
|
||||
$resourcePath = '/fake';
|
||||
@@ -234,20 +234,19 @@ class FakeApi
|
||||
|
||||
|
||||
|
||||
// form params
|
||||
if ($test_code_inject____end____rn_n_r !== null) {
|
||||
$formParams['test code inject */ ' " =end -- \r\n \n \r'] = ObjectSerializer::toFormValue($test_code_inject____end____rn_n_r);
|
||||
}
|
||||
// body params
|
||||
$_tempBody = null;
|
||||
if (isset($unknown_base_type)) {
|
||||
$_tempBody = $unknown_base_type;
|
||||
}
|
||||
|
||||
if ($multipart) {
|
||||
$headers = $this->headerSelector->selectHeadersForMultipart(
|
||||
['application/json', '*_/ \" =end --']
|
||||
[]
|
||||
);
|
||||
} else {
|
||||
$headers = $this->headerSelector->selectHeaders(
|
||||
['application/json', '*_/ \" =end --'],
|
||||
[],
|
||||
['application/json', '*_/ \" =end --']
|
||||
);
|
||||
}
|
||||
@@ -4,29 +4,29 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
namespace OpenAPITools\Client;
|
||||
|
||||
use \Exception;
|
||||
|
||||
@@ -34,9 +34,9 @@ use \Exception;
|
||||
* ApiException Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ApiException extends Exception
|
||||
{
|
||||
@@ -4,38 +4,38 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
namespace OpenAPITools\Client;
|
||||
|
||||
/**
|
||||
* Configuration Class Doc Comment
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Configuration
|
||||
{
|
||||
@@ -81,14 +81,14 @@ class Configuration
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $host = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
|
||||
protected $host = 'petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
|
||||
|
||||
/**
|
||||
* User agent of the HTTP request, set to "PHP-Swagger" by default
|
||||
* User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $userAgent = 'Swagger-Codegen/1.0.0/php';
|
||||
protected $userAgent = 'OpenAPI-Generator/1.0.0/PHP';
|
||||
|
||||
/**
|
||||
* Debug switch (default set to false)
|
||||
@@ -393,7 +393,7 @@ class Configuration
|
||||
*/
|
||||
public static function toDebugReport()
|
||||
{
|
||||
$report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL;
|
||||
$report = 'PHP SDK (OpenAPITools\Client) Debug Report:' . PHP_EOL;
|
||||
$report .= ' OS: ' . php_uname() . PHP_EOL;
|
||||
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
|
||||
$report .= ' OpenAPI Spec Version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r' . PHP_EOL;
|
||||
@@ -4,29 +4,29 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
namespace OpenAPITools\Client;
|
||||
|
||||
use \Exception;
|
||||
|
||||
@@ -34,9 +34,9 @@ use \Exception;
|
||||
* ApiException Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class HeaderSelector
|
||||
{
|
||||
@@ -5,35 +5,35 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client\Model
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client\Model
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
namespace OpenAPITools\Client\Model;
|
||||
|
||||
/**
|
||||
* Interface abstracting model access.
|
||||
*
|
||||
* @package Swagger\Client\Model
|
||||
* @author Swagger Codegen team
|
||||
* @package OpenAPITools\Client\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
interface ModelInterface
|
||||
{
|
||||
@@ -49,14 +49,14 @@ interface ModelInterface
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes();
|
||||
public static function openAPIToolsTypes();
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats();
|
||||
public static function openAPIToolsFormats();
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name, and the value is the original name
|
||||
@@ -5,41 +5,41 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
namespace OpenAPITools\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
use \OpenAPITools\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* ModelReturn Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ModelReturn implements ModelInterface, ArrayAccess
|
||||
{
|
||||
@@ -50,14 +50,14 @@ class ModelReturn implements ModelInterface, ArrayAccess
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'Return';
|
||||
protected static $openAPIToolsModelName = 'Return';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = [
|
||||
protected static $openAPIToolsTypes = [
|
||||
'return' => 'int'
|
||||
];
|
||||
|
||||
@@ -66,7 +66,7 @@ class ModelReturn implements ModelInterface, ArrayAccess
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerFormats = [
|
||||
protected static $openAPIToolsFormats = [
|
||||
'return' => 'int32'
|
||||
];
|
||||
|
||||
@@ -75,9 +75,9 @@ class ModelReturn implements ModelInterface, ArrayAccess
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerTypes()
|
||||
public static function openAPIToolsTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
return self::$openAPIToolsTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,9 +85,9 @@ class ModelReturn implements ModelInterface, ArrayAccess
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function swaggerFormats()
|
||||
public static function openAPIToolsFormats()
|
||||
{
|
||||
return self::$swaggerFormats;
|
||||
return self::$openAPIToolsFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,7 +156,7 @@ class ModelReturn implements ModelInterface, ArrayAccess
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$swaggerModelName;
|
||||
return self::$openAPIToolsModelName;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,8 +201,7 @@ class ModelReturn implements ModelInterface, ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
|
||||
return true;
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,37 +5,37 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
namespace OpenAPITools\Client;
|
||||
|
||||
/**
|
||||
* ObjectSerializer Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ObjectSerializer
|
||||
{
|
||||
@@ -43,8 +43,8 @@ class ObjectSerializer
|
||||
* Serialize data
|
||||
*
|
||||
* @param mixed $data the data to serialize
|
||||
* @param string $type the SwaggerType of the data
|
||||
* @param string $format the format of the Swagger type of the data
|
||||
* @param string $type the OpenAPIToolsType of the data
|
||||
* @param string $format the format of the OpenAPITools type of the data
|
||||
*
|
||||
* @return string|object serialized form of $data
|
||||
*/
|
||||
@@ -61,19 +61,19 @@ class ObjectSerializer
|
||||
return $data;
|
||||
} elseif (is_object($data)) {
|
||||
$values = [];
|
||||
$formats = $data::swaggerFormats();
|
||||
foreach ($data::swaggerTypes() as $property => $swaggerType) {
|
||||
$formats = $data::openAPIToolsFormats();
|
||||
foreach ($data::openAPIToolsTypes() as $property => $openAPIToolsType) {
|
||||
$getter = $data::getters()[$property];
|
||||
$value = $data->$getter();
|
||||
if ($value !== null
|
||||
&& !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
|
||||
&& method_exists($swaggerType, 'getAllowableEnumValues')
|
||||
&& !in_array($value, $swaggerType::getAllowableEnumValues())) {
|
||||
$imploded = implode("', '", $swaggerType::getAllowableEnumValues());
|
||||
throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'");
|
||||
&& !in_array($openAPIToolsType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
|
||||
&& method_exists($openAPIToolsType, 'getAllowableEnumValues')
|
||||
&& !in_array($value, $openAPIToolsType::getAllowableEnumValues())) {
|
||||
$imploded = implode("', '", $openAPIToolsType::getAllowableEnumValues());
|
||||
throw new \InvalidArgumentException("Invalid value for enum '$openAPIToolsType', must be one of: '$imploded'");
|
||||
}
|
||||
if ($value !== null) {
|
||||
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]);
|
||||
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIToolsType, $formats[$property]);
|
||||
}
|
||||
}
|
||||
return (object)$values;
|
||||
@@ -293,13 +293,13 @@ class ObjectSerializer
|
||||
// If a discriminator is defined and points to a valid subclass, use it.
|
||||
$discriminator = $class::DISCRIMINATOR;
|
||||
if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) {
|
||||
$subclass = '\Swagger\Client\Model\\' . $data->{$discriminator};
|
||||
$subclass = '\OpenAPITools\Client\Model\\' . $data->{$discriminator};
|
||||
if (is_subclass_of($subclass, $class)) {
|
||||
$class = $subclass;
|
||||
}
|
||||
}
|
||||
$instance = new $class();
|
||||
foreach ($instance::swaggerTypes() as $property => $type) {
|
||||
foreach ($instance::openAPIToolsTypes() as $property => $type) {
|
||||
$propertySetter = $instance::setters()[$property];
|
||||
|
||||
if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) {
|
||||
@@ -4,41 +4,41 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
namespace OpenAPITools\Client;
|
||||
|
||||
use \Swagger\Client\Configuration;
|
||||
use \Swagger\Client\ApiException;
|
||||
use \Swagger\Client\ObjectSerializer;
|
||||
use \OpenAPITools\Client\Configuration;
|
||||
use \OpenAPITools\Client\ApiException;
|
||||
use \OpenAPITools\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* FakeApiTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class FakeApiTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@@ -5,38 +5,38 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
* Swagger Codegen version: 2.4.0-SNAPSHOT
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
namespace OpenAPITools\Client;
|
||||
|
||||
/**
|
||||
* ModelReturnTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @package Swagger\Client
|
||||
* @author Swagger Codegen team
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
* @package OpenAPITools\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ModelReturnTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
Reference in New Issue
Block a user