Open gradinarufelix opened 1 month ago
I think the check should still be there, but should ignore a missing value. So either
$array['dimensionValues'] ??= [];
at the beginning of the function
or
if (isset($array['dimensionValues']) && !is_array($array['dimensionValues'])) {
throw new \InvalidArgumentException('Dimension values must be an array');
}
should be added.
I'd definitively opt for the client-side solution
I'd still keep the client side solution. But the backend should still check for valid parameters, too.
Yes, that's what I mean (I guess ^^). The backend code should stay as it is and the client must send a valid dimension space point (even with empty coordinates) as an array
Fixes #66. I disabled the check in the query DTOs and fall back to an empty array.
The reason the parameter is entirely missing and not just an empty array is found here:
If
query.dimensionValues
is empty, there is no search parameter added.Another solution would be to improve the client-side passing of the parameter by passing an actually empty array and keep the PHP checks instead.