title: What's the Jackson deserialization equivalent of @JsonUnwrapped?
body: <p>Say I have the following class:</p>
  
  <pre><code>public class Parent {
    public int age;
    @JsonUnwrapped
    public Name name;
  }
  </code></pre>
  
  <p>Producing JSON:</p>
  
  <pre><code>{
    "age" : 18,
    "first" : "Joey",
    "last" : "Sixpack"
  }
  </code></pre>
  
  <p>How do I deserialize this back into the Parent class? I could use @JsonCreator</p>
  
  <pre><code>@JsonCreator
  public Parent(Map&lt;String,String&gt; jsonMap) {
    age = jsonMap.get("age");
    name = new Name(jsonMap.get("first"), jsonMap.get("last"));
  }
  </code></pre>
  
  <p>But this also effectively adds <code>@JsonIgnoreProperties(ignoreUnknown=true)</code> to the Parent class, as all properties map to here. So if you wanted unknown JSON fields to throw an exception, you'd have to do that yourself. In addition, if the map values could be something other than Strings, you'd have to do some manual type checking and conversion. Is there a way for Jackson to handle this case automatically?</p>
  
  <p><strong>Edit:</strong>
  I might be crazy, but this actually appears to work despite never being explicitly mentioned in the documentation: <a href="http://fasterxml.github.io/jackson-annotations/javadoc/2.2.0/com/fasterxml/jackson/annotation/JsonUnwrapped.html" rel="noreferrer">http://fasterxml.github.io/jackson-annotations/javadoc/2.2.0/com/fasterxml/jackson/annotation/JsonUnwrapped.html</a><br>
  I was pretty sure it didn't work for me previously. Still, the proposed @JsonCreator approach might be preferred when custom logic is required to deserialize unwrapped polymorphic types.</p>