diff --git a/modules/openapi-generator/src/main/resources/php/FormDataProcessor.mustache b/modules/openapi-generator/src/main/resources/php/FormDataProcessor.mustache index 0ff4207c167e..2e5d5cb90b33 100644 --- a/modules/openapi-generator/src/main/resources/php/FormDataProcessor.mustache +++ b/modules/openapi-generator/src/main/resources/php/FormDataProcessor.mustache @@ -113,7 +113,11 @@ class FormDataProcessor $currentName .= $currentSuffix; } - $result[$currentName] = ObjectSerializer::toString($val); + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } } $currentName = $start; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/FormDataProcessor.php b/samples/client/petstore/php/OpenAPIClient-php/lib/FormDataProcessor.php index 84e351e8351d..68b939efcd80 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/FormDataProcessor.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/FormDataProcessor.php @@ -121,7 +121,11 @@ public static function flatten(array $source, string $start = ''): array $currentName .= $currentSuffix; } - $result[$currentName] = ObjectSerializer::toString($val); + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } } $currentName = $start; diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php b/samples/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php index f5e32d4c6593..d95b5881262a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php @@ -27,7 +27,7 @@ public function getLastRequest() /** * @param null|ResponseInterface $response */ - public function setResponse(ResponseInterface $response = null) + public function setResponse(?ResponseInterface $response = null) { $this->response = $response; } diff --git a/samples/client/petstore/php/psr-18/lib/FormDataProcessor.php b/samples/client/petstore/php/psr-18/lib/FormDataProcessor.php index 84e351e8351d..68b939efcd80 100644 --- a/samples/client/petstore/php/psr-18/lib/FormDataProcessor.php +++ b/samples/client/petstore/php/psr-18/lib/FormDataProcessor.php @@ -121,7 +121,11 @@ public static function flatten(array $source, string $start = ''): array $currentName .= $currentSuffix; } - $result[$currentName] = ObjectSerializer::toString($val); + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } } $currentName = $start;