-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Description
Given the following server:
import org.jooby.*;
public class Main extends Jooby {
{
get("/test", req -> req.param("foo").toOptional().toString() + "\n");
}
public static void main(final String[] args) throws Throwable {
run(Main::new, args);
}
}Empty parameters are treated as missing:
$ curl localhost:8080/test
Optional.empty
$ curl localhost:8080/test?foo
Optional.empty
$ curl localhost:8080/test?foo=
Optional.empty
$ curl localhost:8080/test?foo=abc
Optional[abc]
One sometime wants to distinguish between an absent and empty parameter. I believe the result should be:
Optional.emptyOptional[]Optional[]Optional[abc]
Any thought on this?
wenerme