Skip to content

Commit c98a780

Browse files
committed
Merge pull request #398 from FindTheBest/master
Fixing issue with deserialization in PHP
2 parents dcaf639 + fd128cb commit c98a780

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/resources/php/Swagger.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ class APIClient {
204204
} elseif ($class == 'DateTime') {
205205
$deserialized = new \DateTime($data);
206206
} elseif (in_array($class, array('string', 'int', 'float', 'bool'))) {
207+
$data = (is_object($data) || is_array($data)) ? json_encode($data) : $data;
207208
settype($data, $class);
208209
$deserialized = $data;
209210
} else {

0 commit comments

Comments
 (0)