-
-
Notifications
You must be signed in to change notification settings - Fork 201
Closed
Labels
Milestone
Description
In addition to exising *Param annotation, Jooby will support a new annotation BindParam that allow you to convert current HTTP context to a desire type.
Case 1: instance method on controller:
@GET("/new-bind")
public Response doSomething(@BindParam MyBean q) {
return ...;
}
MyBean bind(Context ctx) {
// build MyBean from ctx as you want
}Case 2: static method on Mapping class
@GET("/new-bind")
public Response doSomething(@BindParam(MyConverter.class) MyBean q) {
return ...;
}class MyConverter {
public static MyBean convert(Context ctx) {
// build MyBean from ctx as you want
}
}In both cases mapping is function must take io.jooby.Context as argument and returns the required type. Function/method name is optional.
Reactions are currently unavailable