File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
modules/swagger-codegen/src/main/resources/php Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -426,9 +426,16 @@ use {{invokerPackage}}\ObjectSerializer;
426
426
if (isset($_tempBody)) {
427
427
// $_tempBody is the method argument, if present
428
428
$httpBody = $_tempBody ;
429
- // \stdClass has no __toString(), so we should encode it manually
430
- if ($httpBody instanceof \stdClass && $headers [' Content-Type' ] === ' application/json' ) {
431
- $httpBody = \GuzzleHttp\json_encode($httpBody );
429
+
430
+ if ($headers [' Content-Type' ] === ' application/json' ) {
431
+ // \stdClass has no __toString(), so we should encode it manually
432
+ if ($httpBody instanceof \stdClass) {
433
+ $httpBody = \GuzzleHttp\json_encode($httpBody );
434
+ }
435
+ // array has no __toString(), so we should encode it manually
436
+ if(is_array($httpBody)) {
437
+ $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody ));
438
+ }
432
439
}
433
440
} elseif (count($formParams) > 0) {
434
441
if ($multipart ) {
You can’t perform that action at this time.
0 commit comments