Skip to content

Commit ede2150

Browse files
committed
update samples
1 parent 40a0052 commit ede2150

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ public static function deserialize($data, $class, $httpHeaders = null)
262262
return null;
263263
} elseif (strcasecmp(substr($class, -2), '[]') === 0) {
264264
$data = is_string($data) ? json_decode($data) : $data;
265+
266+
if (!is_array($data)) {
267+
throw new \InvalidArgumentException("Invalid array '$class'");
268+
}
269+
265270
$subClass = substr($class, 0, -2);
266271
$values = [];
267272
foreach ($data as $key => $value) {

0 commit comments

Comments
 (0)