diff --git a/modules/openapi-generator/src/main/resources/php/model_generic.mustache b/modules/openapi-generator/src/main/resources/php/model_generic.mustache index f09167eaa892c49423d9e45d8fa51d76e8f207a0..97bb1d93201ce9142fddfde9ff78fb2cfc7fb73a 100644 --- a/modules/openapi-generator/src/main/resources/php/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php/model_generic.mustache @@ -88,6 +88,16 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index fa3da19c0d07662a071f3543895c1e6f8a69b064..73a3e5aa0925910a1843986b2cdd15d678479fcf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -130,6 +130,16 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess, \JsonSer return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php index 34dfc011265ffc561df995d5f67d347842b07560..733110b10ddb46b3a8d37604aa66fce87c85c65c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php @@ -130,6 +130,16 @@ class AllOfWithSingleRef implements ModelInterface, ArrayAccess, \JsonSerializab return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 4d3199a7e86cca7afa0e3be03d39c9d772c6d0b5..cf5296ef4db8a16363626fb691d00b8d7c6cd396 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -130,6 +130,16 @@ class Animal implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 64f032d7d79fbeb001287451f66246006f639730..99861e3d8ddf4e6b8b6d7d90fce6dbaeabc8be40 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -133,6 +133,16 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 2e53ce59e6590c0ecca1bed388d19beaba6d554d..3bb380cc23462bd1d4a322a679a4c8340cfc2e06 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -127,6 +127,16 @@ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess, \JsonSeri return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index f64d52d200e2bceb38ec2e0c354bed43d58717da..557993fe63fce6d773e7c9665c4daa498f8ddb4c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -127,6 +127,16 @@ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess, \JsonSerializabl return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 086f6a0b746ff8b84876a21c512bc7f01298e30f..b2c2f2dc2f1d9d004b17c772911f7261bffd4fe3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -133,6 +133,16 @@ class ArrayTest implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 4d835e07ffed9f22402bc85e0bb39643589433ff..de5e1a8541db14677c9524330cc92e99dbf578ee 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -142,6 +142,16 @@ class Capitalization implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 438862d38e3f37e8e9a005767370de91159c2043..770ba98819e04df8aafa061554ccf99a226240a1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -125,6 +125,16 @@ class Cat extends Animal return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 5e13daeb94a62821fa44f16ff765d725f0a75f80..e060702cb23a86a72794c48aab993909f5589855 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -127,6 +127,16 @@ class CatAllOf implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index a84977ac399cc5e46e315c47148c397834685455..1d2ae35d655a0f206a1474fb926d2c457424dceb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -130,6 +130,16 @@ class Category implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 04de3fd6a27177dac3834abfabfbdfc0fca5d3fe..fa73bf7c31a2c617f1d1eaf807aa853451362c8b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -128,6 +128,16 @@ class ClassModel implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index cf0e8af32add7d4efe44dae5adaf14d9d95e675d..f9b16bfebf6b8ff452900490aafd00a40271c7fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -127,6 +127,16 @@ class Client implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php index 20a23bca61ee77fccbddffe5d46071710979b77a..13e5300d641f08b86974de387b5f216024b251d8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php @@ -127,6 +127,16 @@ class DeprecatedObject implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index bfea79753d6e0fce5fc84620ba4ab3b5032340d2..4e6612658488a13f1dfd7c03f5ae94db3188362c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -125,6 +125,16 @@ class Dog extends Animal return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index afcd0692f17c927c205dbc0b69145a7005303461..45024c02cb7a092a7f0e250113b971d8736c2abb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -127,6 +127,16 @@ class DogAllOf implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index b5de501bb70794400382ca6f80eb4618e8945e47..2f5496e589e1d4dda8237de616d6f82c5efc5e90 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -130,6 +130,16 @@ class EnumArrays implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 1a0ecf9cf7d72a7fd70e6de375933e0200d55b15..ce97dbc862499bca53cf73f69866f81f1802e2dd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -148,6 +148,16 @@ class EnumTest implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 7e9614ac9c03631d1ac748211c0f4cd4612e5fb1..3bd55262cf53c156fe93a4e6009b15b8c21276d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -128,6 +128,16 @@ class File implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index b8936307a6c866c57a34161ff42694097aaa4f2c..0204c5c1e87d6c02b8e34e8acdf01d1dc4af252d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -130,6 +130,16 @@ class FileSchemaTestClass implements ModelInterface, ArrayAccess, \JsonSerializa return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 6c8c5666638ea353be95b5f2f299747f11c28389..4e8c5be63e095c77d23977fd11582b00340f67af 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -127,6 +127,16 @@ class Foo implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php index 325df77076d4d33e197efd76f638b667882e2a38..1512da1d3ac4e1010ce860b2c85b1bc274e49998 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FooGetDefaultResponse.php @@ -127,6 +127,16 @@ class FooGetDefaultResponse implements ModelInterface, ArrayAccess, \JsonSeriali return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 78598c3fbabac706065a96de551d4edab1709820..86d866a92e3e4e85ca1687c665d575585c1fda09 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -172,6 +172,16 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index ecf54ab8be5e21aa57ed82ea6175791901fdbc62..9645089702f1ec608d96aa00dbab18ea9e754239 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -130,6 +130,16 @@ class HasOnlyReadOnly implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 7c7b631a5c1b3b3e871603fe6d848ee328f9b8ad..682560a21b878e22860ae430ecbda36520c0f1b2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -128,6 +128,16 @@ class HealthCheckResult implements ModelInterface, ArrayAccess, \JsonSerializabl return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index fd940d70d8860ae36e15f3c1f32119a7a1ecb7e3..291fa3b8d54e3f81d657085ecfc945472b6a5801 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -136,6 +136,16 @@ class MapTest implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 56c8e8ca5f57c04bec4a02929e737f2a6049e74a..56d8bdde3475e15fd6cb5ee40bdbbbc236eedd1a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -133,6 +133,16 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index b8f03bae1305664019c2bca3f1c469d20dc31aee..803c0291d0a631298f2e18a2944d1427e8224e83 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -131,6 +131,16 @@ class Model200Response implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index a04a0593dd0a3295cf6938bb90044fdc31ab1114..e1d91d26a85563291636bca01795894ee122fcaf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -127,6 +127,16 @@ class ModelList implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 6aa0e1dc2dc5fac677fa1a76c650acb33a444510..634e10970d8e3d942e5da7e9ed53addb59658e12 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -128,6 +128,16 @@ class ModelReturn implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 14d695e4a41dae71855f5744f567ec12fcd75e50..a1f87a5f78c21ab09844e88d3563335d058154aa 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -137,6 +137,16 @@ class Name implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index d453783593d5e6b28ccd2dd3cc094ed88fb76847..eaea61db700b3aeed3d1b992fd651cee3f2bdf4d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -160,6 +160,16 @@ class NullableClass implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 8fe5e0ebe4e53c7b46b84b0bebcbf2c7306bafa1..7fcc89f5a585af21514ce10c28921e202feeac95 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -127,6 +127,16 @@ class NumberOnly implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php index 9b96a6c17b355ce03444ccabff3d8727e75dfe34..773886115624d4ba15c57e8e5ec1f52901afb088 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php @@ -136,6 +136,16 @@ class ObjectWithDeprecatedFields implements ModelInterface, ArrayAccess, \JsonSe return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 87e2fdb9dc195cd7ab520ecd439f0fbfc5fe323d..4fce0c4d1db8cab1f062e331f71be1f21006d1b8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -142,6 +142,16 @@ class Order implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 5d7a0c77540a20fec9cc086ef012e7dc12833485..2666565406cfd71e96cc31faedc10164d2297505 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -133,6 +133,16 @@ class OuterComposite implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php index 9a919511e268a944611a2243c7b06a75f00db99e..50c86ecdd6533c33b875e195ddc15d9ceffc5458 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php @@ -127,6 +127,16 @@ class OuterObjectWithEnumProperty implements ModelInterface, ArrayAccess, \JsonS return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index f6ec9224a679a4029e7620ae3215c3a8953cdf4d..96a8536feb8a82236bdb5db519f97fa9273f3b59 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -142,6 +142,16 @@ class Pet implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 627d13868be60c065e43018d571f5dd76c1798db..826a424a51086e16aaff53090ee7b4336e094507 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -130,6 +130,16 @@ class ReadOnlyFirst implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 54f29735068bad4f8299448f51f5f939a5d05b65..b65b2d706db08d3bf390d24cb60e601092e9b863 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -127,6 +127,16 @@ class SpecialModelName implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index c150fb396b24fcdb7bf670654f2871391aa3a748..60599fa403e7e30d53e40f775fda939b1791305a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -130,6 +130,16 @@ class Tag implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 81fc9bdf74087124a59402408266e1eb42689f8f..975992b00747f4778aec67c0de53783b8e6b6064 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -148,6 +148,16 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable return $this->openAPINullablesSetToNull; } + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + /** * Checks if a property is nullable * diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/NullableTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/NullableTest.php new file mode 100644 index 0000000000000000000000000000000000000000..adac640ce87ef12b2674f1c64db98f7ccf8b2316 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/NullableTest.php @@ -0,0 +1,39 @@ +<?php + +namespace OpenAPI\Client; + +use InvalidArgumentException; +use OpenAPI\Client\Model\Name; +use OpenAPI\Client\Model\NullableClass; +use PHPUnit\Framework\TestCase; + +/** + * class NullableTest + * + * @package OpenAPI\Client + */ +class NullableTest extends TestCase +{ + public function testNotNullableException(): void + { + $name = new Name(); + $name->setName(1); + $this->assertEquals(1, $name->getName(), 'Non-nullable property can be set and retains its value'); + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('non-nullable name cannot be null'); + + $name->setName(null); + } + + public function testNullableobject(): void + { + $nullable = new NullableClass(); + + $nullable->setIntegerProp(null); + $this->assertNull($nullable->getIntegerProp(), 'Nullable property can be set to null retains its value'); + + $nullable->setIntegerProp(1); + $this->assertEquals(1, $nullable->getIntegerProp(), 'Nullable property can be set and retains its value'); + } +} \ No newline at end of file