Parsing empty parameter to non String type should become null instead of 404 #42414
Labels
area/rest
kind/enhancement
New feature or request
triage/duplicate
This issue or pull request already exists
Description
Right now, parsing of non String types throws 404 if parameter is empty (e.g.
?param=
and@RestQuery LocalDate param
), but works whenparam
is omitted or whenparam
is the correct value.This is technically correct and kind of expected, but it clashes with default browser behavior, which sends empty params in the request. In my opinion it would be better if empty value would be treated as null for non String types.
Implementation ideas
One way of doing this that would not break Jakarta spec and be backwards compatible is to add a configuration option/annotation and update the converters.
It is probably important to make this configuration option work for a subset of the default known types, that fail when parsing empty String, not for all non String types, as this might cause issues for custom types.
The text was updated successfully, but these errors were encountered: