From 05eea2436c6251a751ff3b889c410d76aa3ed23e Mon Sep 17 00:00:00 2001 From: Ainun Nazieb Date: Thu, 26 Jan 2017 21:49:38 +0700 Subject: [PATCH] [PHP] Validate parent's model first, if any (#4659) * if model has parent, valid() & listInvalidProperties() will check the parents' first * Run the ./bin/security/php-petstore.sh --- .../main/resources/php/model_generic.mustache | 14 +- .../php/SwaggerClient-php/README.md | 2 +- .../php/SwaggerClient-php/autoload.php | 11 - .../php/SwaggerClient-php/composer.json | 2 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 18 +- .../php/SwaggerClient-php/lib/ApiClient.php | 38 +- .../SwaggerClient-php/lib/ApiException.php | 17 +- .../SwaggerClient-php/lib/Configuration.php | 203 +++++++++- .../lib/Model/ModelReturn.php | 27 +- .../lib/ObjectSerializer.php | 17 +- .../docs/Model/Capitalization.md | 15 + .../lib/Model/AdditionalPropertiesClass.php | 4 +- .../SwaggerClient-php/lib/Model/Animal.php | 4 +- .../lib/Model/AnimalFarm.php | 9 +- .../lib/Model/ApiResponse.php | 4 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 4 +- .../lib/Model/ArrayOfNumberOnly.php | 4 +- .../SwaggerClient-php/lib/Model/ArrayTest.php | 4 +- .../lib/Model/Capitalization.php | 359 ++++++++++++++++++ .../php/SwaggerClient-php/lib/Model/Cat.php | 9 +- .../SwaggerClient-php/lib/Model/Category.php | 4 +- .../lib/Model/ClassModel.php | 4 +- .../SwaggerClient-php/lib/Model/Client.php | 4 +- .../php/SwaggerClient-php/lib/Model/Dog.php | 9 +- .../lib/Model/EnumArrays.php | 4 +- .../SwaggerClient-php/lib/Model/EnumTest.php | 4 +- .../lib/Model/FormatTest.php | 4 +- .../lib/Model/HasOnlyReadOnly.php | 4 +- .../SwaggerClient-php/lib/Model/MapTest.php | 4 +- ...PropertiesAndAdditionalPropertiesClass.php | 4 +- .../lib/Model/Model200Response.php | 4 +- .../SwaggerClient-php/lib/Model/ModelList.php | 4 +- .../lib/Model/ModelReturn.php | 4 +- .../php/SwaggerClient-php/lib/Model/Name.php | 4 +- .../lib/Model/NumberOnly.php | 4 +- .../php/SwaggerClient-php/lib/Model/Order.php | 4 +- .../php/SwaggerClient-php/lib/Model/Pet.php | 4 +- .../lib/Model/ReadOnlyFirst.php | 4 +- .../lib/Model/SpecialModelName.php | 4 +- .../php/SwaggerClient-php/lib/Model/Tag.php | 4 +- .../php/SwaggerClient-php/lib/Model/User.php | 4 +- .../test/Model/CapitalizationTest.php | 133 +++++++ 42 files changed, 846 insertions(+), 141 deletions(-) create mode 100644 samples/client/petstore/php/SwaggerClient-php/docs/Model/Capitalization.md create mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php create mode 100644 samples/client/petstore/php/SwaggerClient-php/test/Model/CapitalizationTest.php diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 114d3372516..ae141ee6cab 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -117,7 +117,13 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple */ public function listInvalidProperties() { + {{#parent}} + $invalid_properties = parent::listInvalidProperties(); + {{/parent}} + {{^parent}} $invalid_properties = []; + {{/parent}} + {{#vars}} {{#required}} if ($this->container['{{name}}'] === null) { @@ -185,10 +191,16 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + {{#parent}} + if (!parent::valid()) { + return false; + } + {{/parent}} + {{#vars}} {{#required}} if ($this->container['{{name}}'] === null) { diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/README.md b/samples/client/petstore-security-test/php/SwaggerClient-php/README.md index e25623732e0..975d73429f4 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/README.md +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/README.md @@ -4,7 +4,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r -- Build package: class io.swagger.codegen.languages.PhpClientCodegen +- Build package: io.swagger.codegen.languages.PhpClientCodegen ## Requirements diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/autoload.php b/samples/client/petstore-security-test/php/SwaggerClient-php/autoload.php index f4d106bc37b..efee00a5f46 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/autoload.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/autoload.php @@ -9,17 +9,6 @@ * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json b/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json index 78602f3be45..7d1a19b4318 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json @@ -8,7 +8,7 @@ "api" ], "homepage": "http://swagger.io", - "license": "Apache-2.0", + "license": "proprietary", "authors": [ { "name": "Swagger and contributors", diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php index d399e789de5..07f9f0e92fb 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -19,17 +18,6 @@ * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ /** @@ -50,8 +38,7 @@ use \Swagger\Client\ObjectSerializer; * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class FakeApi @@ -72,7 +59,6 @@ class FakeApi { if ($apiClient === null) { $apiClient = new ApiClient(); - $apiClient->getConfig()->setHost('https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r'); } $this->apiClient = $apiClient; diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiClient.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiClient.php index c8d7f70fedb..ea22b4f99ee 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiClient.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiClient.php @@ -6,8 +6,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -20,17 +19,6 @@ * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ /** @@ -46,8 +34,7 @@ namespace Swagger\Client; * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ApiClient @@ -176,6 +163,11 @@ class ApiClient if ($this->config->getCurlTimeout() !== 0) { curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); } + // set connect timeout, if needed + if ($this->config->getCurlConnectTimeout() != 0) { + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout()); + } + // return the result on success, rather than just true curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); @@ -187,6 +179,22 @@ class ApiClient curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); } + if ($this->config->getCurlProxyHost()) { + curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost()); + } + + if ($this->config->getCurlProxyPort()) { + curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort()); + } + + if ($this->config->getCurlProxyType()) { + curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType()); + } + + if ($this->config->getCurlProxyUser()) { + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword()); + } + if (!empty($queryParams)) { $url = ($url . '?' . http_build_query($queryParams)); } diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php index 2e320f1bba5..4c029f982ae 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -19,17 +18,6 @@ * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ /** @@ -47,8 +35,7 @@ use \Exception; * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ApiException extends Exception diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php index 69c7ce6bcbd..d430f0c7717 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -19,17 +18,6 @@ * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ /** @@ -46,8 +34,7 @@ namespace Swagger\Client; * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class Configuration @@ -110,6 +97,13 @@ class Configuration */ protected $curlTimeout = 0; + /** + * Timeout (second) of the HTTP connection, by default set to 0, no timeout + * + * @var string + */ + protected $curlConnectTimeout = 0; + /** * User agent of the HTTP request, set to "PHP-Swagger" by default * @@ -147,6 +141,42 @@ class Configuration */ protected $sslVerification = true; + /** + * Curl proxy host + * + * @var string + */ + protected $proxyHost; + + /** + * Curl proxy port + * + * @var integer + */ + protected $proxyPort; + + /** + * Curl proxy type, e.g. CURLPROXY_HTTP or CURLPROXY_SOCKS5 + * + * @see https://secure.php.net/manual/en/function.curl-setopt.php + * @var integer + */ + protected $proxyType; + + /** + * Curl proxy username + * + * @var string + */ + protected $proxyUser; + + /** + * Curl proxy password + * + * @var string + */ + protected $proxyPassword; + /** * Constructor */ @@ -393,6 +423,149 @@ class Configuration return $this->curlTimeout; } + /** + * Sets the HTTP connect timeout value + * + * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] + * + * @return Configuration + */ + public function setCurlConnectTimeout($seconds) + { + if (!is_numeric($seconds) || $seconds < 0) { + throw new \InvalidArgumentException('Connect timeout value must be numeric and a non-negative number.'); + } + + $this->curlConnectTimeout = $seconds; + return $this; + } + + /** + * Gets the HTTP connect timeout value + * + * @return string HTTP connect timeout value + */ + public function getCurlConnectTimeout() + { + return $this->curlConnectTimeout; + } + + + /** + * Sets the HTTP Proxy Host + * + * @param string $proxyHost HTTP Proxy URL + * + * @return ApiClient + */ + public function setCurlProxyHost($proxyHost) + { + $this->proxyHost = $proxyHost; + return $this; + } + + /** + * Gets the HTTP Proxy Host + * + * @return string + */ + public function getCurlProxyHost() + { + return $this->proxyHost; + } + + /** + * Sets the HTTP Proxy Port + * + * @param integer $proxyPort HTTP Proxy Port + * + * @return ApiClient + */ + public function setCurlProxyPort($proxyPort) + { + $this->proxyPort = $proxyPort; + return $this; + } + + /** + * Gets the HTTP Proxy Port + * + * @return integer + */ + public function getCurlProxyPort() + { + return $this->proxyPort; + } + + /** + * Sets the HTTP Proxy Type + * + * @param integer $proxyType HTTP Proxy Type + * + * @return ApiClient + */ + public function setCurlProxyType($proxyType) + { + $this->proxyType = $proxyType; + return $this; + } + + /** + * Gets the HTTP Proxy Type + * + * @return integer + */ + public function getCurlProxyType() + { + return $this->proxyType; + } + + /** + * Sets the HTTP Proxy User + * + * @param string $proxyUser HTTP Proxy User + * + * @return ApiClient + */ + public function setCurlProxyUser($proxyUser) + { + $this->proxyUser = $proxyUser; + return $this; + } + + /** + * Gets the HTTP Proxy User + * + * @return string + */ + public function getCurlProxyUser() + { + return $this->proxyUser; + } + + /** + * Sets the HTTP Proxy Password + * + * @param string $proxyPassword HTTP Proxy Password + * + * @return ApiClient + */ + public function setCurlProxyPassword($proxyPassword) + { + $this->proxyPassword = $proxyPassword; + return $this; + } + + /** + * Gets the HTTP Proxy Password + * + * @return string + */ + public function getCurlProxyPassword() + { + return $this->proxyPassword; + } + /** * Sets debug flag * diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php index 2eade42511f..7f68442329a 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -6,8 +6,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swaagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -20,17 +19,6 @@ * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ /** @@ -46,12 +34,10 @@ use \ArrayAccess; /** * ModelReturn Class Doc Comment * - * @category Class */ - // @description Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r -/** + * @category Class + * @description Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ModelReturn implements ArrayAccess @@ -145,6 +131,7 @@ class ModelReturn implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -152,10 +139,11 @@ class ModelReturn implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } @@ -239,3 +227,4 @@ class ModelReturn implements ArrayAccess } } + diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php index c72c36f24fd..4bfe77988bd 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -6,8 +6,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -20,17 +19,6 @@ * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ /** @@ -46,8 +34,7 @@ namespace Swagger\Client; * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class ObjectSerializer diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/Capitalization.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/Capitalization.md new file mode 100644 index 00000000000..0fcc9e873d7 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **string** | | [optional] +**capital_camel** | **string** | | [optional] +**small_snake** | **string** | | [optional] +**capital_snake** | **string** | | [optional] +**sca_eth_flow_points** | **string** | | [optional] +**att_name** | **string** | Name of the pet | [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/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php index e28f66cc9de..8f901b731a2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -135,6 +135,7 @@ class AdditionalPropertiesClass implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -142,10 +143,11 @@ class AdditionalPropertiesClass implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index 4243f9b3332..a0f1de3c08c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -139,6 +139,7 @@ class Animal implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + if ($this->container['class_name'] === null) { $invalid_properties[] = "'class_name' can't be null"; } @@ -149,10 +150,11 @@ class Animal implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + if ($this->container['class_name'] === null) { return false; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php index 925af36ac0f..d1736598716 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -128,7 +128,8 @@ class AnimalFarm implements ArrayAccess */ public function listInvalidProperties() { - $invalid_properties = []; + $invalid_properties = parent::listInvalidProperties(); + return $invalid_properties; } @@ -136,10 +137,14 @@ class AnimalFarm implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + if (!parent::valid()) { + return false; + } + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index 5e287549990..95148c75e22 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -140,6 +140,7 @@ class ApiResponse implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -147,10 +148,11 @@ class ApiResponse implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 577f2b33f6e..48f3b369b77 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -130,6 +130,7 @@ class ArrayOfArrayOfNumberOnly implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -137,10 +138,11 @@ class ArrayOfArrayOfNumberOnly implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php index 38e503de417..103297a25e0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php @@ -130,6 +130,7 @@ class ArrayOfNumberOnly implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -137,10 +138,11 @@ class ArrayOfNumberOnly implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php index 05becdc3764..f95c8cf869b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php @@ -140,6 +140,7 @@ class ArrayTest implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -147,10 +148,11 @@ class ArrayTest implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php new file mode 100644 index 00000000000..9e124413199 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php @@ -0,0 +1,359 @@ + 'string', + 'capital_camel' => 'string', + 'small_snake' => 'string', + 'capital_snake' => 'string', + 'sca_eth_flow_points' => 'string', + 'att_name' => 'string' + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'small_camel' => 'smallCamel', + 'capital_camel' => 'CapitalCamel', + 'small_snake' => 'small_Snake', + 'capital_snake' => 'Capital_Snake', + 'sca_eth_flow_points' => 'SCA_ETH_Flow_Points', + 'att_name' => 'ATT_NAME' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'small_camel' => 'setSmallCamel', + 'capital_camel' => 'setCapitalCamel', + 'small_snake' => 'setSmallSnake', + 'capital_snake' => 'setCapitalSnake', + 'sca_eth_flow_points' => 'setScaEthFlowPoints', + 'att_name' => 'setAttName' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'small_camel' => 'getSmallCamel', + 'capital_camel' => 'getCapitalCamel', + 'small_snake' => 'getSmallSnake', + 'capital_snake' => 'getCapitalSnake', + 'sca_eth_flow_points' => 'getScaEthFlowPoints', + 'att_name' => 'getAttName' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['small_camel'] = isset($data['small_camel']) ? $data['small_camel'] : null; + $this->container['capital_camel'] = isset($data['capital_camel']) ? $data['capital_camel'] : null; + $this->container['small_snake'] = isset($data['small_snake']) ? $data['small_snake'] : null; + $this->container['capital_snake'] = isset($data['capital_snake']) ? $data['capital_snake'] : null; + $this->container['sca_eth_flow_points'] = isset($data['sca_eth_flow_points']) ? $data['sca_eth_flow_points'] : null; + $this->container['att_name'] = isset($data['att_name']) ? $data['att_name'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets small_camel + * @return string + */ + public function getSmallCamel() + { + return $this->container['small_camel']; + } + + /** + * Sets small_camel + * @param string $small_camel + * @return $this + */ + public function setSmallCamel($small_camel) + { + $this->container['small_camel'] = $small_camel; + + return $this; + } + + /** + * Gets capital_camel + * @return string + */ + public function getCapitalCamel() + { + return $this->container['capital_camel']; + } + + /** + * Sets capital_camel + * @param string $capital_camel + * @return $this + */ + public function setCapitalCamel($capital_camel) + { + $this->container['capital_camel'] = $capital_camel; + + return $this; + } + + /** + * Gets small_snake + * @return string + */ + public function getSmallSnake() + { + return $this->container['small_snake']; + } + + /** + * Sets small_snake + * @param string $small_snake + * @return $this + */ + public function setSmallSnake($small_snake) + { + $this->container['small_snake'] = $small_snake; + + return $this; + } + + /** + * Gets capital_snake + * @return string + */ + public function getCapitalSnake() + { + return $this->container['capital_snake']; + } + + /** + * Sets capital_snake + * @param string $capital_snake + * @return $this + */ + public function setCapitalSnake($capital_snake) + { + $this->container['capital_snake'] = $capital_snake; + + return $this; + } + + /** + * Gets sca_eth_flow_points + * @return string + */ + public function getScaEthFlowPoints() + { + return $this->container['sca_eth_flow_points']; + } + + /** + * Sets sca_eth_flow_points + * @param string $sca_eth_flow_points + * @return $this + */ + public function setScaEthFlowPoints($sca_eth_flow_points) + { + $this->container['sca_eth_flow_points'] = $sca_eth_flow_points; + + return $this; + } + + /** + * Gets att_name + * @return string + */ + public function getAttName() + { + return $this->container['att_name']; + } + + /** + * Sets att_name + * @param string $att_name Name of the pet + * @return $this + */ + public function setAttName($att_name) + { + $this->container['att_name'] = $att_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index 1075c0255bb..611f01e36f4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -131,7 +131,8 @@ class Cat extends Animal implements ArrayAccess */ public function listInvalidProperties() { - $invalid_properties = []; + $invalid_properties = parent::listInvalidProperties(); + return $invalid_properties; } @@ -139,10 +140,14 @@ class Cat extends Animal implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + if (!parent::valid()) { + return false; + } + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index a54e561b591..f8848cb956e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -135,6 +135,7 @@ class Category implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -142,10 +143,11 @@ class Category implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php index 3d635d8d426..18aa0fcbd4b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php @@ -131,6 +131,7 @@ class ClassModel implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -138,10 +139,11 @@ class ClassModel implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php index 2e40da3520a..a6a09cfa3a7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php @@ -130,6 +130,7 @@ class Client implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -137,10 +138,11 @@ class Client implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index 09ed055ddac..ba325f2f8bc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -131,7 +131,8 @@ class Dog extends Animal implements ArrayAccess */ public function listInvalidProperties() { - $invalid_properties = []; + $invalid_properties = parent::listInvalidProperties(); + return $invalid_properties; } @@ -139,10 +140,14 @@ class Dog extends Animal implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + if (!parent::valid()) { + return false; + } + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php index 44bb6e85996..09d496d1926 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php @@ -163,6 +163,7 @@ class EnumArrays implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + $allowed_values = [">=", "$"]; if (!in_array($this->container['just_symbol'], $allowed_values)) { $invalid_properties[] = "invalid value for 'just_symbol', must be one of '>=', '$'."; @@ -175,10 +176,11 @@ class EnumArrays implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + $allowed_values = [">=", "$"]; if (!in_array($this->container['just_symbol'], $allowed_values)) { return false; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php index da3b08d5e6f..bb6d88b4b96 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -189,6 +189,7 @@ class EnumTest implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + $allowed_values = ["UPPER", "lower", ""]; if (!in_array($this->container['enum_string'], $allowed_values)) { $invalid_properties[] = "invalid value for 'enum_string', must be one of 'UPPER', 'lower', ''."; @@ -211,10 +212,11 @@ class EnumTest implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + $allowed_values = ["UPPER", "lower", ""]; if (!in_array($this->container['enum_string'], $allowed_values)) { return false; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index dfbbeea1059..400d9adf3c3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -190,6 +190,7 @@ class FormatTest implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + if (!is_null($this->container['integer']) && ($this->container['integer'] > 100)) { $invalid_properties[] = "invalid value for 'integer', must be smaller than or equal to 100."; } @@ -261,10 +262,11 @@ class FormatTest implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + if ($this->container['integer'] > 100) { return false; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php index e1297ffe65d..953f1550bbc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php @@ -135,6 +135,7 @@ class HasOnlyReadOnly implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -142,10 +143,11 @@ class HasOnlyReadOnly implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php index f435c07fa8b..024ec0b45ee 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php @@ -149,6 +149,7 @@ class MapTest implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -156,10 +157,11 @@ class MapTest implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 78793f32921..a7b8eb94812 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -140,6 +140,7 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -147,10 +148,11 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index 0a27c5ac707..36473dc1dcc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -136,6 +136,7 @@ class Model200Response implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -143,10 +144,11 @@ class Model200Response implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php index 764a13446a6..d2fae7b53f9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php @@ -130,6 +130,7 @@ class ModelList implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -137,10 +138,11 @@ class ModelList implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index 3f1a223605a..f959dbd5065 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -131,6 +131,7 @@ class ModelReturn implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -138,10 +139,11 @@ class ModelReturn implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } 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 4258e8b86d1..61a6838537b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -146,6 +146,7 @@ class Name implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + if ($this->container['name'] === null) { $invalid_properties[] = "'name' can't be null"; } @@ -156,10 +157,11 @@ class Name implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + if ($this->container['name'] === null) { return false; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php index 7b68ff89637..eb5e7f10698 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php @@ -130,6 +130,7 @@ class NumberOnly implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -137,10 +138,11 @@ class NumberOnly implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 56f63be8a27..1b70e5914b6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -171,6 +171,7 @@ class Order implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + $allowed_values = ["placed", "approved", "delivered"]; if (!in_array($this->container['status'], $allowed_values)) { $invalid_properties[] = "invalid value for 'status', must be one of 'placed', 'approved', 'delivered'."; @@ -183,10 +184,11 @@ class Order implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + $allowed_values = ["placed", "approved", "delivered"]; if (!in_array($this->container['status'], $allowed_values)) { return false; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 5589879cbce..88ddce6611c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -171,6 +171,7 @@ class Pet implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + if ($this->container['name'] === null) { $invalid_properties[] = "'name' can't be null"; } @@ -189,10 +190,11 @@ class Pet implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + if ($this->container['name'] === null) { return false; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php index 9e7f593c27d..b53677fc495 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php @@ -135,6 +135,7 @@ class ReadOnlyFirst implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -142,10 +143,11 @@ class ReadOnlyFirst implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index bfd4a350446..ac73ff0a376 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -130,6 +130,7 @@ class SpecialModelName implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -137,10 +138,11 @@ class SpecialModelName implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index 8aad5ec3297..1705129380b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -135,6 +135,7 @@ class Tag implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -142,10 +143,11 @@ class Tag implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index b93eb1e5f58..583a94ca57c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -165,6 +165,7 @@ class User implements ArrayAccess public function listInvalidProperties() { $invalid_properties = []; + return $invalid_properties; } @@ -172,10 +173,11 @@ class User implements ArrayAccess * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { + return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/CapitalizationTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/CapitalizationTest.php new file mode 100644 index 00000000000..48e309b787f --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/CapitalizationTest.php @@ -0,0 +1,133 @@ +