users@jersey.java.net

[Jersey] Deserialize Resource Using Jackson _at_JsonView

From: blake t <jawbreak47_at_gmail.com>
Date: Sun, 26 Jul 2015 09:37:54 -0700

Hello,

Does anyone have an example of how to implement Jackson's @JsonView to work
during deserialization? I would like to be able to deserialize directly in
the resource method differently depending on the method.

It would be nice to be able to do something close to this:
@POST
@Path("/book/create")
@Produces(MediaType.APPLICATION_JSON)
public Response create(@JsonView(BookViews.create.class) Book book) throws
Exception {
}

@POST
@Path("/book/update")
@Produces(MediaType.APPLICATION_JSON)
public Response create(@JsonView(BookViews.update.class) Book book) throws
Exception {
}

Any thoughts is much appreciated.
Thanks.