@GET
@Path("/book")
public Response getBook(@BeanParam Filter filter) {
}
Filter paramater is getting initialized but nothing is set in the bean
class Filter {@QueryParam("author")String author}
I do have setter and getter for all properties present in Filter object.
F.Y.I. I am using the HK2 guice-bridge.
I was able to reproduce the problem with guice-bridge. It seems that when the bridge is initialized (via guiceBridge.bridgeGuiceInjector(...)), only the BeanParam's default constructor is being called instead of also setting the properties (or calling the constructor with parameters).
If it's possible in your project, you could try to provide a constructor with parameters.
This is a simple app:
The used service:
And here's a simple bean:
Using Guice version 4.1.0, guice-bridge version 2.4.0, Jersey version 2.25.1 and Javax servlet version 3.1.0.