forked from loafle/openapi-generator-original
[PHP] Bugfix: DateTime object on query (#13583)
* [PHP] BUGFIX: fix code breaking when query params contain a DateTime object * [PHP] Autogenerated files
This commit is contained in:
@@ -189,6 +189,11 @@ class ObjectSerializer
|
||||
}
|
||||
}
|
||||
|
||||
# Handle DateTime objects in query
|
||||
if($openApiType === "\\DateTime" && $value instanceof \DateTime) {
|
||||
return ["{$paramName}" => $value->format(self::$dateTimeFormat)];
|
||||
}
|
||||
|
||||
$query = [];
|
||||
$value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user