diff --git a/modules/openapi-generator/src/main/resources/php/FormDataProcessor.mustache b/modules/openapi-generator/src/main/resources/php/FormDataProcessor.mustache index 0ff4207c167..2e5d5cb90b3 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 84e351e8351..68b939efcd8 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 @@ 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/tests/FakeHttpClient.php b/samples/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php index f5e32d4c659..d95b5881262 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 @@ class FakeHttpClient implements ClientInterface /** * @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 84e351e8351..68b939efcd8 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 @@ class FormDataProcessor $currentName .= $currentSuffix; } - $result[$currentName] = ObjectSerializer::toString($val); + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } } $currentName = $start;