1

I'm using Jackson 2 on a JAX-RS project, and I have a method that expects a JSON with this structure:

{
    "actor": { "name": "Joe" },
    "movie": { "title": "The Movie" }
}

I was able to map this to an object using a custom wrapper class:

class MyInput {
    Actor actor;
    Movie movie;
}

// resource method signature:
public Response query(MyInput input);

Is it possible to avoid using the custom class, and have Jackson map the actor and movie properties directly to parameters?

I would then use a method like this:

public Response query(Actor actor, Movie movie);
vixprogram
  • 61
  • 2

0 Answers0