From f409411a5a37abbfee4b4ec719384ae7fb736fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hinrik=20=C3=96rn=20Sigur=C3=B0sson?= Date: Wed, 2 Oct 2019 10:41:27 +0200 Subject: [PATCH 1/4] [PHP] Correctly format JSON in headers `ObjectSerializer::toHeaderValue()` in the generated PHP code calls `toString()` on the values, which formats JSON with the `JSON_PRETTY_PRINT` option. This will result in a multi-line header which cannot be parsed since linebreaks aren't allowed by RFC 7230. In my case I have a header schema called `UpdateUser` which I had hoped would be serialized as `{"type":"staff","id":123}`. Every single `__toString()` in the generator does the same thing, so I figured it's safe to change `toHeaderValue()` to convert to JSON directly, without `JSON_PRETTY_PRINT`. This fix works for me. --- .../src/main/resources/php/ObjectSerializer.mustache | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 526665f27173..389624d71b30 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -140,7 +140,7 @@ class ObjectSerializer */ public static function toHeaderValue($value) { - return self::toString($value); + return json_encode(ObjectSerializer::sanitizeForSerialization($value)); } /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 15f94983bdb3..1cab666f0709 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,7 +150,7 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - return self::toString($value); + return json_encode(ObjectSerializer::sanitizeForSerialization($value)); } /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 15f94983bdb3..1cab666f0709 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,7 +150,7 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - return self::toString($value); + return json_encode(ObjectSerializer::sanitizeForSerialization($value)); } /** From 83b0532bcc88d5e64ff2b8f8246cc2f03b8bcf58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hinrik=20=C3=96rn=20Sigur=C3=B0sson?= Date: Wed, 2 Oct 2019 12:06:01 +0200 Subject: [PATCH 2/4] More sensible approach to providing a header value --- .../src/main/resources/php/ObjectSerializer.mustache | 6 +++++- .../src/main/resources/php/model_generic.mustache | 10 ++++++++++ .../lib/Model/AdditionalPropertiesAnyType.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesArray.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesBoolean.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesClass.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesInteger.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesNumber.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesObject.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesString.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Animal.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 10 ++++++++++ .../lib/Model/ArrayOfArrayOfNumberOnly.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/CatAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Category.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Client.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/DogAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/File.php | 10 ++++++++++ .../lib/Model/FileSchemaTestClass.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/MapTest.php | 10 ++++++++++ .../MixedPropertiesAndAdditionalPropertiesClass.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/Model200Response.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelList.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/SpecialModelName.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/TypeHolderDefault.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/TypeHolderExample.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/XmlItem.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 6 +++++- .../lib/Model/AdditionalPropertiesClass.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Animal.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 10 ++++++++++ .../lib/Model/ArrayOfArrayOfNumberOnly.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/CatAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Category.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Client.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/DogAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/File.php | 10 ++++++++++ .../lib/Model/FileSchemaTestClass.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/HealthCheckResult.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject1.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject2.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject3.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject4.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject5.php | 10 ++++++++++ .../lib/Model/InlineResponseDefault.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/MapTest.php | 10 ++++++++++ .../MixedPropertiesAndAdditionalPropertiesClass.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/Model200Response.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelList.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/NullableClass.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/SpecialModelName.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 6 +++++- 92 files changed, 905 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 389624d71b30..f5f0e5119efc 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -140,7 +140,11 @@ class ObjectSerializer */ public static function toHeaderValue($value) { - return json_encode(ObjectSerializer::sanitizeForSerialization($value)); + if (method_exists($value, 'toHeaderValue')) { + return $value->toHeaderValue(); + } + + return self::toString($value); } /** 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 98a892cb927c..adc72e548797 100644 --- a/modules/openapi-generator/src/main/resources/php/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php/model_generic.mustache @@ -410,4 +410,14 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php index 0bf2b7f55519..da01a9b5c1fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php index 8cc76ce8d8ae..bc8fd1d658ed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php index d603dea6cf20..3bfdbf7e5036 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 7356db34be2f..cfd2252533f3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -592,6 +592,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php index 7ade96c13788..19c8a96a0014 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php index 659cbd2df243..f977732205a4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php index 9fe67b2a5e52..0e692f76f4f7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php index ad1b652f01fe..ee7dead8006c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 ac6d9082b733..c748f906d308 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -328,6 +328,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 c1c82d76cdac..50460e1a424b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 e32b6781485e..eed60bf506e9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 a76f5d3acb3e..30d40add5df9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 f7b3381a8839..21042cc353a5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 774560b79d81..b9471781012a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -442,6 +442,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 55fd5cda68be..54cc95bea663 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 3bb9a232581e..2fb6a88dda0e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 29c35d5df876..2de722afbc8f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -325,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 a7b2ae94562b..397ac5aeaadc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 0f025e7227a2..180391207dcf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 6a0a37286693..05ddcebe6bbf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 7d8024ced11f..7d6644d16a16 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 c28dd01ffada..c58252a75277 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -378,6 +378,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 06de6bc11ce2..29aee0500ac6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -547,6 +547,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 6260508cfd57..40a7e74bbd5b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 f89f41deaf48..03700c2f91a7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 94226cfa2fae..53a290037520 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -807,6 +807,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 08017cad244e..9650bfe68560 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 8d1b080c9460..3273da281226 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -406,6 +406,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 1b37ce50fc4b..5ae886f08b0e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 e0dbe01e2c1a..f2c23fd102b1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -323,6 +323,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 5554b691ef41..fb279d988009 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 b8d680ea28d6..1b0163b1f8d2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 4af627fd82a9..a445d7c337a3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -386,6 +386,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 ebfc25987897..af5582cbba55 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 2579c56894af..328f833fa52b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -476,6 +476,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 4d0d721e7186..14db823f8a06 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 040fb6ebaa17..7a36afafe641 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -482,6 +482,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 4f2a6d0accb5..327535d7837d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 6cd441183cc7..2afd85ed3954 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 3fc3e71f80cc..a5faaf19a4cf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php index 6d0b39f9d3be..702b636c0e39 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php @@ -427,6 +427,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php index 3794ed5ea482..c9581aee6953 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php @@ -460,6 +460,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 75fc5ba92fef..0aec7974a61e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -502,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php index 81c18ddef3b7..a164e01a00ea 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php @@ -1132,6 +1132,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 1cab666f0709..925f2cd64ade 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,7 +150,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - return json_encode(ObjectSerializer::sanitizeForSerialization($value)); + if (method_exists($value, 'toHeaderValue')) { + return $value->toHeaderValue(); + } + + return self::toString($value); } /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 0bd2db1525db..a6bcee886089 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index ac6d9082b733..c748f906d308 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -328,6 +328,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index c1c82d76cdac..50460e1a424b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index e32b6781485e..eed60bf506e9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index a76f5d3acb3e..30d40add5df9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index f7b3381a8839..21042cc353a5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 774560b79d81..b9471781012a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -442,6 +442,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 55fd5cda68be..54cc95bea663 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 3bb9a232581e..2fb6a88dda0e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 29c35d5df876..2de722afbc8f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -325,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index a7b2ae94562b..397ac5aeaadc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 0f025e7227a2..180391207dcf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 6a0a37286693..05ddcebe6bbf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 7d8024ced11f..7d6644d16a16 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index c28dd01ffada..c58252a75277 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -378,6 +378,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 312b7be653a6..f5a1b35b30b2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -637,6 +637,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 6260508cfd57..40a7e74bbd5b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index f89f41deaf48..03700c2f91a7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 751796331eca..68c7fb3783b8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 27c658fda47a..5af8dff294d0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -846,6 +846,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 08017cad244e..9650bfe68560 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index e0a532a367ee..2f254c0c1218 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php index bbb8e53a6c97..a5fffaf99b8d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php index 5f97ad46602c..5f8b2abefb2f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php index 7d6de50ed245..02cf3f871a30 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php @@ -380,6 +380,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php index fa36a2bf5944..c96f5a31164f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php @@ -800,6 +800,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php index 38ebe9f0e95d..010832a0403a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php @@ -328,6 +328,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php index 901209f5867b..11eb1ba7acbd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php @@ -325,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index e36553623461..db42d3f128c2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 8d1b080c9460..3273da281226 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -406,6 +406,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 1b37ce50fc4b..5ae886f08b0e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index e0dbe01e2c1a..f2c23fd102b1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -323,6 +323,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 5554b691ef41..fb279d988009 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index b8d680ea28d6..1b0163b1f8d2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 4af627fd82a9..a445d7c337a3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -386,6 +386,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index c7f4f4a12958..5b3ce503e761 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -622,6 +622,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index ebfc25987897..af5582cbba55 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 2579c56894af..328f833fa52b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -476,6 +476,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 4d0d721e7186..14db823f8a06 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 040fb6ebaa17..7a36afafe641 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -482,6 +482,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 4f2a6d0accb5..327535d7837d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 443319649538..4e95bc03cdf4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 3fc3e71f80cc..a5faaf19a4cf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 75fc5ba92fef..0aec7974a61e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -502,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 1cab666f0709..925f2cd64ade 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,7 +150,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - return json_encode(ObjectSerializer::sanitizeForSerialization($value)); + if (method_exists($value, 'toHeaderValue')) { + return $value->toHeaderValue(); + } + + return self::toString($value); } /** From f8a7450027353d164c490491cabf5fe78a445b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hinrik=20=C3=96rn=20Sigur=C3=B0sson?= Date: Wed, 2 Oct 2019 13:33:16 +0200 Subject: [PATCH 3/4] Just strip the newlines --- .../src/main/resources/php/ObjectSerializer.mustache | 6 +----- .../src/main/resources/php/model_generic.mustache | 10 ---------- .../lib/Model/AdditionalPropertiesAnyType.php | 10 ---------- .../lib/Model/AdditionalPropertiesArray.php | 10 ---------- .../lib/Model/AdditionalPropertiesBoolean.php | 10 ---------- .../lib/Model/AdditionalPropertiesClass.php | 10 ---------- .../lib/Model/AdditionalPropertiesInteger.php | 10 ---------- .../lib/Model/AdditionalPropertiesNumber.php | 10 ---------- .../lib/Model/AdditionalPropertiesObject.php | 10 ---------- .../lib/Model/AdditionalPropertiesString.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Animal.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 10 ---------- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 10 ---------- .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/CatAllOf.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Category.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Client.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/DogAllOf.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/File.php | 10 ---------- .../lib/Model/FileSchemaTestClass.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 10 ---------- .../OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/MapTest.php | 10 ---------- .../MixedPropertiesAndAdditionalPropertiesClass.php | 10 ---------- .../OpenAPIClient-php/lib/Model/Model200Response.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ModelList.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 10 ---------- .../OpenAPIClient-php/lib/Model/SpecialModelName.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 10 ---------- .../OpenAPIClient-php/lib/Model/TypeHolderDefault.php | 10 ---------- .../OpenAPIClient-php/lib/Model/TypeHolderExample.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/XmlItem.php | 10 ---------- .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 6 +----- .../lib/Model/AdditionalPropertiesClass.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Animal.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 10 ---------- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 10 ---------- .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/CatAllOf.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Category.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/Client.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/DogAllOf.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/File.php | 10 ---------- .../lib/Model/FileSchemaTestClass.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 10 ---------- .../OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 10 ---------- .../OpenAPIClient-php/lib/Model/HealthCheckResult.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/InlineObject.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/InlineObject1.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/InlineObject2.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/InlineObject3.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/InlineObject4.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/InlineObject5.php | 10 ---------- .../lib/Model/InlineResponseDefault.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/MapTest.php | 10 ---------- .../MixedPropertiesAndAdditionalPropertiesClass.php | 10 ---------- .../OpenAPIClient-php/lib/Model/Model200Response.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ModelList.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/NullableClass.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 10 ---------- .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 10 ---------- .../OpenAPIClient-php/lib/Model/SpecialModelName.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 10 ---------- .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 10 ---------- .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 6 +----- 92 files changed, 3 insertions(+), 905 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index f5f0e5119efc..68bda5a6df80 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -140,11 +140,7 @@ class ObjectSerializer */ public static function toHeaderValue($value) { - if (method_exists($value, 'toHeaderValue')) { - return $value->toHeaderValue(); - } - - return self::toString($value); + return str_replace(PHP_EOL, '', (string)$value); } /** 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 adc72e548797..98a892cb927c 100644 --- a/modules/openapi-generator/src/main/resources/php/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php/model_generic.mustache @@ -410,14 +410,4 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php index da01a9b5c1fe..0bf2b7f55519 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php index bc8fd1d658ed..8cc76ce8d8ae 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php index 3bfdbf7e5036..d603dea6cf20 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 cfd2252533f3..7356db34be2f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -592,16 +592,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php index 19c8a96a0014..7ade96c13788 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php index f977732205a4..659cbd2df243 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php index 0e692f76f4f7..9fe67b2a5e52 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php index ee7dead8006c..ad1b652f01fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 c748f906d308..ac6d9082b733 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -328,16 +328,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 50460e1a424b..c1c82d76cdac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 eed60bf506e9..e32b6781485e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 30d40add5df9..a76f5d3acb3e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 21042cc353a5..f7b3381a8839 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 b9471781012a..774560b79d81 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -442,16 +442,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 54cc95bea663..55fd5cda68be 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -286,16 +286,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 2fb6a88dda0e..3bb9a232581e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 2de722afbc8f..29c35d5df876 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -325,16 +325,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 397ac5aeaadc..a7b2ae94562b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -293,16 +293,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 180391207dcf..0f025e7227a2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 05ddcebe6bbf..6a0a37286693 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -286,16 +286,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 7d6644d16a16..7d8024ced11f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 c58252a75277..c28dd01ffada 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -378,16 +378,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 29aee0500ac6..06de6bc11ce2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -547,16 +547,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 40a7e74bbd5b..6260508cfd57 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -293,16 +293,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 03700c2f91a7..f89f41deaf48 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 53a290037520..94226cfa2fae 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -807,16 +807,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 9650bfe68560..08017cad244e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 3273da281226..8d1b080c9460 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -406,16 +406,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 5ae886f08b0e..1b37ce50fc4b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 f2c23fd102b1..e0dbe01e2c1a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -323,16 +323,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 fb279d988009..5554b691ef41 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 1b0163b1f8d2..b8d680ea28d6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -293,16 +293,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 a445d7c337a3..4af627fd82a9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -386,16 +386,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 af5582cbba55..ebfc25987897 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 328f833fa52b..2579c56894af 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -476,16 +476,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 14db823f8a06..4d0d721e7186 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 7a36afafe641..040fb6ebaa17 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -482,16 +482,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 327535d7837d..4f2a6d0accb5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 2afd85ed3954..6cd441183cc7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 a5faaf19a4cf..3fc3e71f80cc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php index 702b636c0e39..6d0b39f9d3be 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php @@ -427,16 +427,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php index c9581aee6953..3794ed5ea482 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php @@ -460,16 +460,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } 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 0aec7974a61e..75fc5ba92fef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -502,16 +502,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php index a164e01a00ea..81c18ddef3b7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php @@ -1132,16 +1132,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 925f2cd64ade..3c36651ec20a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,11 +150,7 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - if (method_exists($value, 'toHeaderValue')) { - return $value->toHeaderValue(); - } - - return self::toString($value); + return str_replace(PHP_EOL, '', (string)$value); } /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index a6bcee886089..0bd2db1525db 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index c748f906d308..ac6d9082b733 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -328,16 +328,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 50460e1a424b..c1c82d76cdac 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index eed60bf506e9..e32b6781485e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 30d40add5df9..a76f5d3acb3e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 21042cc353a5..f7b3381a8839 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index b9471781012a..774560b79d81 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -442,16 +442,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 54cc95bea663..55fd5cda68be 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -286,16 +286,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 2fb6a88dda0e..3bb9a232581e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 2de722afbc8f..29c35d5df876 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -325,16 +325,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 397ac5aeaadc..a7b2ae94562b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -293,16 +293,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 180391207dcf..0f025e7227a2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 05ddcebe6bbf..6a0a37286693 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -286,16 +286,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 7d6644d16a16..7d8024ced11f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index c58252a75277..c28dd01ffada 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -378,16 +378,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index f5a1b35b30b2..312b7be653a6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -637,16 +637,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 40a7e74bbd5b..6260508cfd57 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -293,16 +293,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 03700c2f91a7..f89f41deaf48 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 68c7fb3783b8..751796331eca 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 5af8dff294d0..27c658fda47a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -846,16 +846,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 9650bfe68560..08017cad244e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 2f254c0c1218..e0a532a367ee 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -293,16 +293,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php index a5fffaf99b8d..bbb8e53a6c97 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php index 5f8b2abefb2f..5f97ad46602c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php index 02cf3f871a30..7d6de50ed245 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php @@ -380,16 +380,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php index c96f5a31164f..fa36a2bf5944 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php @@ -800,16 +800,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php index 010832a0403a..38ebe9f0e95d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php @@ -328,16 +328,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php index 11eb1ba7acbd..901209f5867b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php @@ -325,16 +325,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index db42d3f128c2..e36553623461 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 3273da281226..8d1b080c9460 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -406,16 +406,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 5ae886f08b0e..1b37ce50fc4b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index f2c23fd102b1..e0dbe01e2c1a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -323,16 +323,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index fb279d988009..5554b691ef41 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 1b0163b1f8d2..b8d680ea28d6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -293,16 +293,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index a445d7c337a3..4af627fd82a9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -386,16 +386,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index 5b3ce503e761..c7f4f4a12958 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -622,16 +622,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index af5582cbba55..ebfc25987897 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 328f833fa52b..2579c56894af 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -476,16 +476,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 14db823f8a06..4d0d721e7186 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -352,16 +352,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 7a36afafe641..040fb6ebaa17 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -482,16 +482,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 327535d7837d..4f2a6d0accb5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 4e95bc03cdf4..443319649538 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -292,16 +292,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index a5faaf19a4cf..3fc3e71f80cc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -322,16 +322,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 0aec7974a61e..75fc5ba92fef 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -502,16 +502,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 925f2cd64ade..3c36651ec20a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,11 +150,7 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - if (method_exists($value, 'toHeaderValue')) { - return $value->toHeaderValue(); - } - - return self::toString($value); + return str_replace(PHP_EOL, '', (string)$value); } /** From a02d5a450d1f31a74c2b7179e3956b0c2301b1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hinrik=20=C3=96rn=20Sigur=C3=B0sson?= Date: Thu, 3 Oct 2019 09:06:38 +0200 Subject: [PATCH 4/4] Go back to previous solution --- .../src/main/resources/php/ObjectSerializer.mustache | 6 +++++- .../src/main/resources/php/model_generic.mustache | 10 ++++++++++ .../lib/Model/AdditionalPropertiesAnyType.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesArray.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesBoolean.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesClass.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesInteger.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesNumber.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesObject.php | 10 ++++++++++ .../lib/Model/AdditionalPropertiesString.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Animal.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 10 ++++++++++ .../lib/Model/ArrayOfArrayOfNumberOnly.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/CatAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Category.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Client.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/DogAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/File.php | 10 ++++++++++ .../lib/Model/FileSchemaTestClass.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/MapTest.php | 10 ++++++++++ .../MixedPropertiesAndAdditionalPropertiesClass.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/Model200Response.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelList.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/SpecialModelName.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/TypeHolderDefault.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/TypeHolderExample.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/XmlItem.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 6 +++++- .../lib/Model/AdditionalPropertiesClass.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Animal.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 10 ++++++++++ .../lib/Model/ArrayOfArrayOfNumberOnly.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/CatAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Category.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/Client.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/DogAllOf.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/File.php | 10 ++++++++++ .../lib/Model/FileSchemaTestClass.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/HealthCheckResult.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject1.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject2.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject3.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject4.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/InlineObject5.php | 10 ++++++++++ .../lib/Model/InlineResponseDefault.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/MapTest.php | 10 ++++++++++ .../MixedPropertiesAndAdditionalPropertiesClass.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/Model200Response.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelList.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/NullableClass.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 10 ++++++++++ .../OpenAPIClient-php/lib/Model/SpecialModelName.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 10 ++++++++++ .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 10 ++++++++++ .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 6 +++++- 92 files changed, 905 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 68bda5a6df80..f5f0e5119efc 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -140,7 +140,11 @@ class ObjectSerializer */ public static function toHeaderValue($value) { - return str_replace(PHP_EOL, '', (string)$value); + if (method_exists($value, 'toHeaderValue')) { + return $value->toHeaderValue(); + } + + return self::toString($value); } /** 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 98a892cb927c..adc72e548797 100644 --- a/modules/openapi-generator/src/main/resources/php/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php/model_generic.mustache @@ -410,4 +410,14 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php index 0bf2b7f55519..da01a9b5c1fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php index 8cc76ce8d8ae..bc8fd1d658ed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php index d603dea6cf20..3bfdbf7e5036 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 7356db34be2f..cfd2252533f3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -592,6 +592,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php index 7ade96c13788..19c8a96a0014 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php index 659cbd2df243..f977732205a4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php index 9fe67b2a5e52..0e692f76f4f7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php index ad1b652f01fe..ee7dead8006c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 ac6d9082b733..c748f906d308 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -328,6 +328,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 c1c82d76cdac..50460e1a424b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 e32b6781485e..eed60bf506e9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 a76f5d3acb3e..30d40add5df9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 f7b3381a8839..21042cc353a5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 774560b79d81..b9471781012a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -442,6 +442,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 55fd5cda68be..54cc95bea663 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 3bb9a232581e..2fb6a88dda0e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 29c35d5df876..2de722afbc8f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -325,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 a7b2ae94562b..397ac5aeaadc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 0f025e7227a2..180391207dcf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 6a0a37286693..05ddcebe6bbf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 7d8024ced11f..7d6644d16a16 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 c28dd01ffada..c58252a75277 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -378,6 +378,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 06de6bc11ce2..29aee0500ac6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -547,6 +547,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 6260508cfd57..40a7e74bbd5b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 f89f41deaf48..03700c2f91a7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 94226cfa2fae..53a290037520 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -807,6 +807,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 08017cad244e..9650bfe68560 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 8d1b080c9460..3273da281226 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -406,6 +406,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 1b37ce50fc4b..5ae886f08b0e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 e0dbe01e2c1a..f2c23fd102b1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -323,6 +323,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 5554b691ef41..fb279d988009 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 b8d680ea28d6..1b0163b1f8d2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 4af627fd82a9..a445d7c337a3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -386,6 +386,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 ebfc25987897..af5582cbba55 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 2579c56894af..328f833fa52b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -476,6 +476,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 4d0d721e7186..14db823f8a06 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 040fb6ebaa17..7a36afafe641 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -482,6 +482,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 4f2a6d0accb5..327535d7837d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 6cd441183cc7..2afd85ed3954 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 3fc3e71f80cc..a5faaf19a4cf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php index 6d0b39f9d3be..702b636c0e39 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php @@ -427,6 +427,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php index 3794ed5ea482..c9581aee6953 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php @@ -460,6 +460,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } 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 75fc5ba92fef..0aec7974a61e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -502,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php index 81c18ddef3b7..a164e01a00ea 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php @@ -1132,6 +1132,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 3c36651ec20a..925f2cd64ade 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,7 +150,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - return str_replace(PHP_EOL, '', (string)$value); + if (method_exists($value, 'toHeaderValue')) { + return $value->toHeaderValue(); + } + + return self::toString($value); } /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 0bd2db1525db..a6bcee886089 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index ac6d9082b733..c748f906d308 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -328,6 +328,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index c1c82d76cdac..50460e1a424b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index e32b6781485e..eed60bf506e9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index a76f5d3acb3e..30d40add5df9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index f7b3381a8839..21042cc353a5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 774560b79d81..b9471781012a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -442,6 +442,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 55fd5cda68be..54cc95bea663 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 3bb9a232581e..2fb6a88dda0e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 29c35d5df876..2de722afbc8f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -325,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index a7b2ae94562b..397ac5aeaadc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 0f025e7227a2..180391207dcf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 6a0a37286693..05ddcebe6bbf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -286,6 +286,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 7d8024ced11f..7d6644d16a16 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index c28dd01ffada..c58252a75277 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -378,6 +378,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 312b7be653a6..f5a1b35b30b2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -637,6 +637,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 6260508cfd57..40a7e74bbd5b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index f89f41deaf48..03700c2f91a7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 751796331eca..68c7fb3783b8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 27c658fda47a..5af8dff294d0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -846,6 +846,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 08017cad244e..9650bfe68560 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index e0a532a367ee..2f254c0c1218 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php index bbb8e53a6c97..a5fffaf99b8d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php index 5f97ad46602c..5f8b2abefb2f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php index 7d6de50ed245..02cf3f871a30 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php @@ -380,6 +380,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php index fa36a2bf5944..c96f5a31164f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php @@ -800,6 +800,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php index 38ebe9f0e95d..010832a0403a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php @@ -328,6 +328,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php index 901209f5867b..11eb1ba7acbd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php @@ -325,6 +325,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index e36553623461..db42d3f128c2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 8d1b080c9460..3273da281226 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -406,6 +406,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 1b37ce50fc4b..5ae886f08b0e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index e0dbe01e2c1a..f2c23fd102b1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -323,6 +323,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 5554b691ef41..fb279d988009 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index b8d680ea28d6..1b0163b1f8d2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -293,6 +293,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 4af627fd82a9..a445d7c337a3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -386,6 +386,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index c7f4f4a12958..5b3ce503e761 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -622,6 +622,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index ebfc25987897..af5582cbba55 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 2579c56894af..328f833fa52b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -476,6 +476,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 4d0d721e7186..14db823f8a06 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -352,6 +352,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 040fb6ebaa17..7a36afafe641 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -482,6 +482,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 4f2a6d0accb5..327535d7837d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 443319649538..4e95bc03cdf4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -292,6 +292,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 3fc3e71f80cc..a5faaf19a4cf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -322,6 +322,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 75fc5ba92fef..0aec7974a61e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -502,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 3c36651ec20a..925f2cd64ade 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -150,7 +150,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { - return str_replace(PHP_EOL, '', (string)$value); + if (method_exists($value, 'toHeaderValue')) { + return $value->toHeaderValue(); + } + + return self::toString($value); } /**