diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache index 5970d93dc958..b2d1cf65835b 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache @@ -358,6 +358,8 @@ class ObjectSerializer */ public static function serializeCollection(array $collection, string $style, bool $allowCollectionFormatMulti = false): string { + $collection = array_map([self::class, 'sanitizeForSerialization'], $collection); + if ($allowCollectionFormatMulti && ('multi' === $style)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays.