Skip to content

Commit 8323fdf

Browse files
committed
Fixing deserialization bug in PHP bindings
1 parent 0c3f066 commit 8323fdf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules/swagger-codegen/src/main/resources/php/Swagger.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class APIClient {
248248
} elseif ($class == 'DateTime') {
249249
$deserialized = new \DateTime($data);
250250
} elseif (in_array($class, array('string', 'int', 'float', 'bool'))) {
251+
$data = (is_object($data) || is_array($data)) ? json_encode($data) : $data;
251252
settype($data, $class);
252253
$deserialized = $data;
253254
} else {

0 commit comments

Comments
 (0)