Skip to content

Commit dd80d1a

Browse files
committed
[php] Backport OpenAPITools#21458 to php client
Fixes OpenAPITools#21485 Credits to @jozefbriss
1 parent f1a0935 commit dd80d1a

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

modules/openapi-generator/src/main/resources/php/FormDataProcessor.mustache

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ class FormDataProcessor
113113
$currentName .= $currentSuffix;
114114
}
115115

116-
$result[$currentName] = ObjectSerializer::toString($val);
116+
if (is_resource($val)) {
117+
$result[$currentName] = $val;
118+
} else {
119+
$result[$currentName] = ObjectSerializer::toString($val);
120+
}
117121
}
118122

119123
$currentName = $start;

samples/client/petstore/php/OpenAPIClient-php/lib/FormDataProcessor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ public static function flatten(array $source, string $start = ''): array
121121
$currentName .= $currentSuffix;
122122
}
123123

124-
$result[$currentName] = ObjectSerializer::toString($val);
124+
if (is_resource($val)) {
125+
$result[$currentName] = $val;
126+
} else {
127+
$result[$currentName] = ObjectSerializer::toString($val);
128+
}
125129
}
126130

127131
$currentName = $start;

samples/client/petstore/php/psr-18/lib/FormDataProcessor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ public static function flatten(array $source, string $start = ''): array
121121
$currentName .= $currentSuffix;
122122
}
123123

124-
$result[$currentName] = ObjectSerializer::toString($val);
124+
if (is_resource($val)) {
125+
$result[$currentName] = $val;
126+
} else {
127+
$result[$currentName] = ObjectSerializer::toString($val);
128+
}
125129
}
126130

127131
$currentName = $start;

0 commit comments

Comments
 (0)