Fix ObjectSerializer::isEmptyValue to not consider "0" as "" (#19472)

This commit is contained in:
Sobhan Sharifi
2024-09-02 11:03:36 +03:00
committed by GitHub
parent 5b96e85fd5
commit 0643f526af
8 changed files with 27 additions and 0 deletions

View File

@@ -198,6 +198,9 @@ class ObjectSerializer
# For boolean values, '' is considered empty
'bool','boolean' => !in_array($value, [false, 0], true),
# For string values, '' is considered empty.
'string' => $value === '',
# For all the other types, any value at this point can be considered empty.
default => true
};