Closed mdesharnais closed 8 years ago
I introduced this change in previous release. The motivation was form submits where if you leave some field blank you get an empty string for me this should be treat as missing, simplify form validation.
What is the use case for treating empty parameter as empty list? For example:
get("/test", req -> req.param("foo").toList() + "\n");
Give you []
for ?foo
or ?foo=
Elasticsearch have a ?pretty
to pretty format the json result.
Odd, but how an empty list will help there? Still not sure if ?pretty
is a valid use case... feel empty string as optional works better in general.
well, got some issues/questions about this in the google group... think going to revert the changes I did... will that work for you guys?
Hello, I am a little bit late on the train, but @wenerme gave the exact example I was referring to: a flag to enable a functionality.
was reverted found another way of handling absent/empty string while submitting forms
👍
Given the following server:
Empty parameters are treated as missing:
One sometime wants to distinguish between an absent and empty parameter. I believe the result should be:
Optional.empty
Optional[]
Optional[]
Optional[abc]
Any thought on this?