title: What @JsonTypeInfo.ID to choose for property = "type.id" for deserialization, JsonTypeInfo.Id.CUSTOM?
body: <p>So I have JSON that looks like this:</p>
  <pre><code>{
      &quot;ActivityDisplayModel&quot; : {
          &quot;name&quot; : &quot;lunch with friends&quot;,
          &quot;startTime&quot; : &quot;12:00:00&quot;,
          &quot;type&quot; : {
              &quot;id&quot; : &quot;MEAL&quot;,
              &quot;description&quot; : &quot;Meal&quot;
          },
          &quot;complete&quot; : false
      }
  }
  </code></pre>
  <p>I'm trying to find the way to get <code>@JsonTypeInfo</code> to not be mad at me for having the type parameter inside the <code>type</code> object. I've got this working before when the field <code>type</code> was a String and not an object itself, but for later processing I need it as an object. I know the following doesn't work, and I'm guessing theres a way to use <a href="http://fasterxml.github.io/jackson-annotations/javadoc/2.3.0/com/fasterxml/jackson/annotation/JsonTypeInfo.Id.html#CUSTOM" rel="nofollow noreferrer">JsonTypeInfo.Id.CUSTOM</a>, but after looking all over on the internet, no full examples with JSON have come up. Also, if this is possible with an objectMapper setting, I'm all ears.</p>
  <pre><code>/** 
   * My ActivityDisplayModel Abstract Class
   */
  @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = &quot;type.id&quot;)
  @JsonSubTypes({
  @JsonSubTypes.Type(value = MealDisplayModel.class, name = &quot;MEAL&quot;),
  @JsonSubTypes.Type(value = EntertainmentDisplayModel.class, name = &quot;ENTERTAINMENT&quot;)
  })
  public abstract class ActivityDisplayModel { 
      ...
  </code></pre>
  <p>The above is essentially what I want to do, but of course I get an exception of:</p>
  <pre><code>Could not read JSON: Could not resolve type id '{' into a subtype of  [simple type, class ... .ActivityDisplayModel]
  </code></pre>
  <p>For such a simple problem of just looking one level deeper in the JSON, who would have thought it would have been so much trouble?</p>