diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 27e76e1ac3c..4088ddf1fbe 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -3,7 +3,7 @@ {{{appDescription}}} {{/appDescription}} -This SDK 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: - API verion: {{appVersion}} - Package version: {{artifactVersion}} @@ -20,7 +20,7 @@ PHP 5.4.0 and later ## Installation & Usage ### Composer -You can install the bindings via [Composer](http://getcomposer.org/). Add this to your `composer.json`: +To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: ``` { @@ -36,11 +36,12 @@ You can install the bindings via [Composer](http://getcomposer.org/). Add this t } ``` -Then install via `composer install` +Then run `composer install` ### Manual Installation -If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the `autoload.php` file. +Download the files and include `autoload.php`: + ```php require_once('/path/to/{{packagePath}}/autoload.php'); ``` @@ -48,6 +49,7 @@ If you do not wish to use Composer, you can download the latest release. Then, t ## Tests To run the unit tests: + ``` composer install ./vendor/bin/phpunit lib/Tests @@ -55,24 +57,24 @@ composer install ## Getting Started -Please follow the installation procedure and then run the following: +Please follow the [installation procedure](#installation--usage) and then run the following: ```php setUsername('YOUR_USERNAME'); -{{{invokerPackage}}}::getDefaultConfiguration->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}} +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME'); +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}} // Configure API key authorization: {{{name}}} -{{{invokerPackage}}}::getDefaultConfiguration->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// {{{invokerPackage}}}::getDefaultConfiguration->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}} +// {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}} // Configure OAuth2 access token for authorization: {{{name}}} -{{{invokerPackage}}}::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} {{/hasAuthMethods}} -$api_instance = new {{invokerPackage}}\{{classname}}(); +$api_instance = new {{invokerPackage}}\Api\{{classname}}(); {{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} diff --git a/modules/swagger-codegen/src/main/resources/php/api_doc.mustache b/modules/swagger-codegen/src/main/resources/php/api_doc.mustache index a4377003803..bb55e80604c 100644 --- a/modules/swagger-codegen/src/main/resources/php/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api_doc.mustache @@ -23,17 +23,17 @@ Method | HTTP request | Description require_once(__DIR__ . '/vendor/autoload.php'); {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}} // Configure HTTP basic authorization: {{{name}}} -{{{invokerPackage}}}::getDefaultConfiguration->setUsername('YOUR_USERNAME'); -{{{invokerPackage}}}::getDefaultConfiguration->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}} +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME'); +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');{{/isBasic}}{{#isApiKey}} // Configure API key authorization: {{{name}}} -{{{invokerPackage}}}::getDefaultConfiguration->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// {{{invokerPackage}}}::getDefaultConfiguration->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}} +// {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}} // Configure OAuth2 access token for authorization: {{{name}}} -{{{invokerPackage}}}::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} +{{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');{{/isOAuth}}{{/authMethods}} {{/hasAuthMethods}} -$api_instance = new {{invokerPackage}}\{{classname}}(); +$api_instance = new {{invokerPackage}}\Api\{{classname}}(); {{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index c756dda5568..7fe80fb8a06 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -1,11 +1,11 @@ # SwaggerClient-php This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters -This SDK 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: - API verion: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-03-18T00:51:26.562+01:00 +- Build date: 2016-03-19T16:11:03.465+08:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -15,7 +15,7 @@ PHP 5.4.0 and later ## Installation & Usage ### Composer -You can install the bindings via [Composer](http://getcomposer.org/). Add this to your `composer.json`: +To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: ``` { @@ -31,11 +31,12 @@ You can install the bindings via [Composer](http://getcomposer.org/). Add this t } ``` -Then install via `composer install` +Then run `composer install` ### Manual Installation -If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the `autoload.php` file. +Download the files and include `autoload.php`: + ```php require_once('/path/to/SwaggerClient-php/autoload.php'); ``` @@ -43,6 +44,7 @@ If you do not wish to use Composer, you can download the latest release. Then, t ## Tests To run the unit tests: + ``` composer install ./vendor/bin/phpunit lib/Tests @@ -50,16 +52,16 @@ composer install ## Getting Started -Please follow the installation procedure and then run the following: +Please follow the [installation procedure](#installation--usage) and then run the following: ```php setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$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 { @@ -121,25 +123,10 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - -## test_api_client_id +## test_api_key_header - **Type**: API key -- **API key parameter name**: x-test_api_client_id -- **Location**: HTTP header - -## test_api_client_secret - -- **Type**: API key -- **API key parameter name**: x-test_api_client_secret +- **API key parameter name**: test_api_key_header - **Location**: HTTP header ## api_key @@ -152,17 +139,32 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## test_api_client_secret + +- **Type**: API key +- **API key parameter name**: x-test_api_client_secret +- **Location**: HTTP header + +## test_api_client_id + +- **Type**: API key +- **API key parameter name**: x-test_api_client_id +- **Location**: HTTP header + ## test_api_key_query - **Type**: API key - **API key parameter name**: test_api_key_query - **Location**: URL query string -## test_api_key_header +## petstore_auth -- **Type**: API key -- **API key parameter name**: test_api_key_header -- **Location**: HTTP header +- **Type**: OAuth +- **Flow**: implicit +- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets ## Author diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/InlineResponse200.md b/samples/client/petstore/php/SwaggerClient-php/docs/InlineResponse200.md index f24bffc16fa..1c0b9237453 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/InlineResponse200.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/InlineResponse200.md @@ -3,12 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**photo_urls** | **string[]** | | [optional] -**name** | **string** | | [optional] +**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional] **id** | **int** | | **category** | **object** | | [optional] -**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional] **status** | **string** | pet status in the store | [optional] +**name** | **string** | | [optional] +**photo_urls** | **string[]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Name.md b/samples/client/petstore/php/SwaggerClient-php/docs/Name.md index b9842d31abf..26473221c32 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Name.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Name.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **int** | | [optional] +**snake_case** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md index ab24be1f152..b21d4b595b1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md @@ -30,9 +30,9 @@ Add a new pet to the store require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$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 { @@ -77,9 +77,9 @@ Fake endpoint to test byte array in body parameter for adding a new pet to the s require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $body = "B"; // string | Pet object in the form of byte array try { @@ -124,9 +124,9 @@ Deletes a pet require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $pet_id = 789; // int | Pet id to delete $api_key = "api_key_example"; // string | @@ -173,9 +173,9 @@ Multiple status values can be provided with comma separated strings require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $status = array("available"); // string[] | Status values that need to be considered for query try { @@ -221,9 +221,9 @@ Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $tags = array("tags_example"); // string[] | Tags to filter by try { @@ -268,14 +268,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond setAccessToken('YOUR_ACCESS_TOKEN'); // Configure API key authorization: api_key -Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER'); +// Configure OAuth2 access token for authorization: petstore_auth +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $pet_id = 789; // int | ID of pet that needs to be fetched try { @@ -299,7 +299,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) +[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) ### HTTP reuqest headers @@ -320,14 +320,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond setAccessToken('YOUR_ACCESS_TOKEN'); // Configure API key authorization: api_key -Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER'); +// Configure OAuth2 access token for authorization: petstore_auth +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $pet_id = 789; // int | ID of pet that needs to be fetched try { @@ -351,7 +351,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) +[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) ### HTTP reuqest headers @@ -372,14 +372,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond setAccessToken('YOUR_ACCESS_TOKEN'); // Configure API key authorization: api_key -Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER'); +// Configure OAuth2 access token for authorization: petstore_auth +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $pet_id = 789; // int | ID of pet that needs to be fetched try { @@ -403,7 +403,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) +[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) ### HTTP reuqest headers @@ -425,9 +425,9 @@ Update an existing pet require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$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 { @@ -472,9 +472,9 @@ Updates a pet in the store with form data require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $pet_id = "pet_id_example"; // string | ID of pet that needs to be updated $name = "name_example"; // string | Updated name of the pet $status = "status_example"; // string | Updated status of the pet @@ -523,9 +523,9 @@ uploads an image require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: petstore_auth -Swagger\Client::getDefaultConfiguration->setAccessToken('YOUR_ACCESS_TOKEN'); +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$api_instance = new Swagger\Client\PetApi(); +$api_instance = new Swagger\Client\Api\PetApi(); $pet_id = 789; // int | ID of pet to update $additional_metadata = "additional_metadata_example"; // string | Additional data to pass to server $file = "/path/to/file.txt"; // \SplFileObject | file to upload diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md index a33154ee754..a414755a82d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md @@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non setApiKey('x-test_api_client_id', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_id', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER'); // Configure API key authorization: test_api_client_secret -Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_secret', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER'); -$api_instance = new Swagger\Client\StoreApi(); +$api_instance = new Swagger\Client\Api\StoreApi(); $status = "placed"; // string | Status value that needs to be considered for query try { @@ -123,11 +123,11 @@ Returns a map of status codes to quantities require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api_key -Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER'); -$api_instance = new Swagger\Client\StoreApi(); +$api_instance = new Swagger\Client\Api\StoreApi(); try { $result = $api_instance->getInventory(); @@ -169,11 +169,11 @@ Returns an arbitrary object which is actually a map of status codes to quantitie require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api_key -Swagger\Client::getDefaultConfiguration->setApiKey('api_key', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('api_key', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER'); -$api_instance = new Swagger\Client\StoreApi(); +$api_instance = new Swagger\Client\Api\StoreApi(); try { $result = $api_instance->getInventoryInObject(); @@ -214,16 +214,16 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge setApiKey('test_api_key_query', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('test_api_key_query', 'BEARER'); // Configure API key authorization: test_api_key_header -Swagger\Client::getDefaultConfiguration->setApiKey('test_api_key_header', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_header', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('test_api_key_header', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_header', 'BEARER'); +// Configure API key authorization: test_api_key_query +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER'); -$api_instance = new Swagger\Client\StoreApi(); +$api_instance = new Swagger\Client\Api\StoreApi(); $order_id = "order_id_example"; // string | ID of pet that needs to be fetched try { @@ -247,7 +247,7 @@ Name | Type | Description | Notes ### Authorization -[test_api_key_query](../README.md#test_api_key_query), [test_api_key_header](../README.md#test_api_key_header) +[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query) ### HTTP reuqest headers @@ -269,15 +269,15 @@ Place an order for a pet require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: test_api_client_id -Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_id', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_id', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER'); // Configure API key authorization: test_api_client_secret -Swagger\Client::getDefaultConfiguration->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY'); +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. BEARER) for API key, if needed -// Swagger\Client::getDefaultConfiguration->setApiKeyPrefix('x-test_api_client_secret', 'BEARER'); +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER'); -$api_instance = new Swagger\Client\StoreApi(); +$api_instance = new Swagger\Client\Api\StoreApi(); $body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet try { diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md index 45e49d3e9ab..46f508fe293 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md @@ -26,7 +26,7 @@ This can only be done by the logged in user. setUsername('YOUR_USERNAME'); -Swagger\Client::getDefaultConfiguration->setPassword('YOUR_PASSWORD'); +Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME'); +Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD'); -$api_instance = new Swagger\Client\UserApi(); +$api_instance = new Swagger\Client\Api\UserApi(); $username = "username_example"; // string | The name that needs to be deleted try { @@ -206,7 +206,7 @@ Get user by user name logoutUser(); @@ -338,7 +338,7 @@ This can only be done by the logged in user. apiClient->getConfig()->getAccessToken()) !== 0) { - $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); - } - // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('api_key'); if (strlen($apiKey) !== 0) { @@ -630,6 +625,11 @@ class PetApi } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -725,11 +725,6 @@ class PetApi $httpBody = $formParams; // for HTTP post (form) } - // this endpoint requires OAuth (access token) - if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { - $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); - } - // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('api_key'); if (strlen($apiKey) !== 0) { @@ -737,6 +732,11 @@ class PetApi } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -832,11 +832,6 @@ class PetApi $httpBody = $formParams; // for HTTP post (form) } - // this endpoint requires OAuth (access token) - if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { - $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); - } - // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('api_key'); if (strlen($apiKey) !== 0) { @@ -844,6 +839,11 @@ class PetApi } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index 3b6b2aa43b6..b510b4a3b6e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -525,16 +525,16 @@ class StoreApi } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query'); + $apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header'); if (strlen($apiKey) !== 0) { - $queryParams['test_api_key_query'] = $apiKey; + $headerParams['test_api_key_header'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header'); + $apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query'); if (strlen($apiKey) !== 0) { - $headerParams['test_api_key_header'] = $apiKey; + $queryParams['test_api_key_query'] = $apiKey; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php index a3acd422e2c..6d3fc1259bf 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php @@ -51,12 +51,12 @@ class InlineResponse200 implements ArrayAccess * @var string[] */ static $swaggerTypes = array( - 'photo_urls' => 'string[]', - 'name' => 'string', + 'tags' => '\Swagger\Client\Model\Tag[]', 'id' => 'int', 'category' => 'object', - 'tags' => '\Swagger\Client\Model\Tag[]', - 'status' => 'string' + 'status' => 'string', + 'name' => 'string', + 'photo_urls' => 'string[]' ); static function swaggerTypes() { @@ -68,12 +68,12 @@ class InlineResponse200 implements ArrayAccess * @var string[] */ static $attributeMap = array( - 'photo_urls' => 'photoUrls', - 'name' => 'name', + 'tags' => 'tags', 'id' => 'id', 'category' => 'category', - 'tags' => 'tags', - 'status' => 'status' + 'status' => 'status', + 'name' => 'name', + 'photo_urls' => 'photoUrls' ); static function attributeMap() { @@ -85,12 +85,12 @@ class InlineResponse200 implements ArrayAccess * @var string[] */ static $setters = array( - 'photo_urls' => 'setPhotoUrls', - 'name' => 'setName', + 'tags' => 'setTags', 'id' => 'setId', 'category' => 'setCategory', - 'tags' => 'setTags', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'name' => 'setName', + 'photo_urls' => 'setPhotoUrls' ); static function setters() { @@ -102,12 +102,12 @@ class InlineResponse200 implements ArrayAccess * @var string[] */ static $getters = array( - 'photo_urls' => 'getPhotoUrls', - 'name' => 'getName', + 'tags' => 'getTags', 'id' => 'getId', 'category' => 'getCategory', - 'tags' => 'getTags', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'name' => 'getName', + 'photo_urls' => 'getPhotoUrls' ); static function getters() { @@ -116,16 +116,10 @@ class InlineResponse200 implements ArrayAccess /** - * $photo_urls - * @var string[] + * $tags + * @var \Swagger\Client\Model\Tag[] */ - protected $photo_urls; - - /** - * $name - * @var string - */ - protected $name; + protected $tags; /** * $id @@ -139,18 +133,24 @@ class InlineResponse200 implements ArrayAccess */ protected $category; - /** - * $tags - * @var \Swagger\Client\Model\Tag[] - */ - protected $tags; - /** * $status pet status in the store * @var string */ protected $status; + /** + * $name + * @var string + */ + protected $name; + + /** + * $photo_urls + * @var string[] + */ + protected $photo_urls; + /** * Constructor @@ -159,54 +159,33 @@ class InlineResponse200 implements ArrayAccess public function __construct(array $data = null) { if ($data != null) { - $this->photo_urls = $data["photo_urls"]; - $this->name = $data["name"]; + $this->tags = $data["tags"]; $this->id = $data["id"]; $this->category = $data["category"]; - $this->tags = $data["tags"]; $this->status = $data["status"]; + $this->name = $data["name"]; + $this->photo_urls = $data["photo_urls"]; } } /** - * Gets photo_urls - * @return string[] + * Gets tags + * @return \Swagger\Client\Model\Tag[] */ - public function getPhotoUrls() + public function getTags() { - return $this->photo_urls; + return $this->tags; } /** - * Sets photo_urls - * @param string[] $photo_urls + * Sets tags + * @param \Swagger\Client\Model\Tag[] $tags * @return $this */ - public function setPhotoUrls($photo_urls) + public function setTags($tags) { - $this->photo_urls = $photo_urls; - return $this; - } - - /** - * Gets name - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets name - * @param string $name - * @return $this - */ - public function setName($name) - { - - $this->name = $name; + $this->tags = $tags; return $this; } @@ -252,27 +231,6 @@ class InlineResponse200 implements ArrayAccess return $this; } - /** - * Gets tags - * @return \Swagger\Client\Model\Tag[] - */ - public function getTags() - { - return $this->tags; - } - - /** - * Sets tags - * @param \Swagger\Client\Model\Tag[] $tags - * @return $this - */ - public function setTags($tags) - { - - $this->tags = $tags; - return $this; - } - /** * Gets status * @return string @@ -297,6 +255,48 @@ class InlineResponse200 implements ArrayAccess return $this; } + /** + * Gets name + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name + * @param string $name + * @return $this + */ + public function setName($name) + { + + $this->name = $name; + return $this; + } + + /** + * Gets photo_urls + * @return string[] + */ + public function getPhotoUrls() + { + return $this->photo_urls; + } + + /** + * Sets photo_urls + * @param string[] $photo_urls + * @return $this + */ + public function setPhotoUrls($photo_urls) + { + + $this->photo_urls = $photo_urls; + return $this; + } + /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index f4e6f1b14a7..ee1b6097eae 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -51,7 +51,8 @@ class Name implements ArrayAccess * @var string[] */ static $swaggerTypes = array( - 'name' => 'int' + 'name' => 'int', + 'snake_case' => 'int' ); static function swaggerTypes() { @@ -63,7 +64,8 @@ class Name implements ArrayAccess * @var string[] */ static $attributeMap = array( - 'name' => 'name' + 'name' => 'name', + 'snake_case' => 'snake_case' ); static function attributeMap() { @@ -75,7 +77,8 @@ class Name implements ArrayAccess * @var string[] */ static $setters = array( - 'name' => 'setName' + 'name' => 'setName', + 'snake_case' => 'setSnakeCase' ); static function setters() { @@ -87,7 +90,8 @@ class Name implements ArrayAccess * @var string[] */ static $getters = array( - 'name' => 'getName' + 'name' => 'getName', + 'snake_case' => 'getSnakeCase' ); static function getters() { @@ -101,6 +105,12 @@ class Name implements ArrayAccess */ protected $name; + /** + * $snake_case + * @var int + */ + protected $snake_case; + /** * Constructor @@ -110,6 +120,7 @@ class Name implements ArrayAccess { if ($data != null) { $this->name = $data["name"]; + $this->snake_case = $data["snake_case"]; } } @@ -134,6 +145,27 @@ class Name implements ArrayAccess return $this; } + /** + * Gets snake_case + * @return int + */ + public function getSnakeCase() + { + return $this->snake_case; + } + + /** + * Sets snake_case + * @param int $snake_case + * @return $this + */ + public function setSnakeCase($snake_case) + { + + $this->snake_case = $snake_case; + return $this; + } + /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index 7dbd6a55c46..e0a0efc03ca 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -257,7 +257,7 @@ class ObjectSerializer } else { $deserialized = null; } - } elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) { + } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) { settype($data, $class); $deserialized = $data; } elseif ($class === '\SplFileObject') { diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php index 4587a99cf24..a01f384d68e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php @@ -43,7 +43,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $new_pet->setTags(array($tag)); $new_pet->setCategory($category); - $pet_api = new Swagger\Client\Api\PetAPI(); + $pet_api = new Swagger\Client\Api\PetApi(); // add a new pet (model) $add_response = $pet_api->addPet($new_pet); } @@ -74,14 +74,14 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $defaultHeader = $api_client->getConfig()->getDefaultHeaders(); $this->assertFalse(isset($defaultHeader['test2'])); - $pet_api2 = new Swagger\Client\Api\PetAPI(); + $pet_api2 = new Swagger\Client\Api\PetApi(); $config3 = new Swagger\Client\Configuration(); $apiClient3 = new Swagger\Client\ApiClient($config3); $apiClient3->getConfig()->setUserAgent('api client 3'); $config4 = new Swagger\Client\Configuration(); $apiClient4 = new Swagger\Client\ApiClient($config4); $apiClient4->getConfig()->setUserAgent('api client 4'); - $pet_api3 = new Swagger\Client\Api\PetAPI($apiClient3); + $pet_api3 = new Swagger\Client\Api\PetApi($apiClient3); // 2 different api clients are not the same $this->assertNotEquals($apiClient3, $apiClient4); @@ -98,7 +98,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase { // initialize the API client without host $pet_id = 10005; // ID of pet that needs to be fetched - $pet_api = new Swagger\Client\Api\PetAPI(); + $pet_api = new Swagger\Client\Api\PetApi(); $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555'); // return Pet (model) $response = $pet_api->getPetById($pet_id); @@ -116,7 +116,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase { // initialize the API client without host $pet_id = 10005; // ID of pet that needs to be fetched - $pet_api = new Swagger\Client\Api\PetAPI(); + $pet_api = new Swagger\Client\Api\PetApi(); $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555'); // return Pet (inline model) $response = $pet_api->getPetByIdInObject($pet_id); @@ -139,7 +139,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase { // initialize the API client without host $pet_id = 10005; // ID of pet that needs to be fetched - $pet_api = new Swagger\Client\Api\PetAPI(); + $pet_api = new Swagger\Client\Api\PetApi(); $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555'); // return Pet (model) list($response, $status_code, $response_headers) = $pet_api->getPetByIdWithHttpInfo($pet_id); @@ -159,7 +159,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase // initialize the API client $config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2'); $api_client = new Swagger\Client\ApiClient($config); - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // return Pet (model) $response = $pet_api->findPetsByStatus("available"); $this->assertGreaterThan(0, count($response)); // at least one object returned @@ -179,7 +179,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase // initialize the API client $config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2'); $api_client = new Swagger\Client\ApiClient($config); - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // return Pet (model) $response = $pet_api->findPetsByTags("test php tag"); $this->assertGreaterThan(0, count($response)); // at least one object returned @@ -200,7 +200,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2'); $api_client = new Swagger\Client\ApiClient($config); $pet_id = 10001; // ID of pet that needs to be fetched - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // create updated pet object $updated_pet = new Swagger\Client\Model\Pet; $updated_pet->setId($pet_id); @@ -224,7 +224,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2'); $api_client = new Swagger\Client\ApiClient($config); $pet_id = 10001; // ID of pet that needs to be fetched - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // update Pet (form) list($update_response, $status_code, $http_headers) = $pet_api->updatePetWithFormWithHttpInfo($pet_id, 'update pet with form with http info'); // return nothing (void) @@ -243,7 +243,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2'); $api_client = new Swagger\Client\ApiClient($config); $pet_id = 10001; // ID of pet that needs to be fetched - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // update Pet (form) $update_response = $pet_api->updatePetWithForm($pet_id, 'update pet with form', 'sold'); // return nothing (void) @@ -264,7 +264,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $new_pet = new Swagger\Client\Model\Pet; $new_pet->setId($new_pet_id); $new_pet->setName("PHP Unit Test 2"); - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // add a new pet (model) $add_response = $pet_api->addPet($new_pet); // return nothing (void) @@ -298,7 +298,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $new_pet->setTags(array($tag)); $new_pet->setCategory($category); - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // add a new pet (model) $object_serializer = new Swagger\Client\ObjectSerializer(); $pet_json_string = json_encode($object_serializer->sanitizeForSerialization($new_pet)); @@ -319,7 +319,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase // initialize the API client $config = (new Swagger\Client\Configuration())->setHost('http://petstore.swagger.io/v2'); $api_client = new Swagger\Client\ApiClient($config); - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // upload file $pet_id = 10001; $add_response = $pet_api->uploadFile($pet_id, "test meta", "./composer.json"); @@ -349,7 +349,7 @@ class PetApiTest extends \PHPUnit_Framework_TestCase $config = new Swagger\Client\Configuration(); $config->setHost('http://petstore.swagger.io/v2'); $api_client = new Swagger\Client\APIClient($config); - $pet_api = new Swagger\Client\Api\PetAPI($api_client); + $pet_api = new Swagger\Client\Api\PetApi($api_client); // test getPetByIdWithByteArray $pet_id = 10005; $bytes = $pet_api->petPetIdtestingByteArraytrueGet($pet_id);