@@ -80,7 +80,8 @@ public enum Id {
8080 /**
8181 * This means that no explicit type metadata is included, and typing is
8282 * purely done using contextual information possibly augmented with other
83- * annotations.
83+ * annotations. Or, format-specific metadata mechanism is used.
84+ * Typically used with {@link As#NOTHING}.
8485 */
8586 NONE (null ),
8687
@@ -175,7 +176,7 @@ private Id(String defProp) {
175176
176177 /**
177178 * Definition of standard type inclusion mechanisms for type metadata.
178- * Used for standard metadata types, except for {@link Id#NONE} .
179+ * Used for standard metadata types.
179180 * May or may not be used for custom types ({@link Id#CUSTOM}).
180181 */
181182 public enum As {
@@ -240,7 +241,17 @@ public enum As {
240241 *
241242 * @since 2.3 but databind <b>only since 2.5</b>.
242243 */
243- EXISTING_PROPERTY
244+ EXISTING_PROPERTY ,
245+
246+ /**
247+ * Pseudo-value used as marker for case where no in-data Type Id is included:
248+ * either because separate metadata (using format native mechanism) is used,
249+ * or inference mechanism is used or possibly no Type Id is used at all
250+ * (to match {@link Id#NONE} case).
251+ *
252+ * @since 2.21
253+ */
254+ NOTHING
244255 ;
245256 }
246257
@@ -376,9 +387,9 @@ public static class Value
376387 {
377388 private static final long serialVersionUID = 1L ;
378389
379- // should not really be needed usually but make sure defalts to `NONE`; other
390+ // should not really be needed usually but make sure defaults to `NONE`; other
380391 // values of less interest
381- protected final static Value EMPTY = new Value (Id .NONE , As .PROPERTY , null , null , false , null );
392+ protected final static Value EMPTY = new Value (Id .NONE , As .NOTHING , null , null , false , null );
382393
383394 protected final Id _idType ;
384395 protected final As _inclusionType ;
@@ -493,7 +504,8 @@ public Class<JsonTypeInfo> valueFor() {
493504 */
494505 public static boolean isEnabled (JsonTypeInfo .Value v ) {
495506 return (v != null ) &&
496- (v ._idType != null ) && (v ._idType != Id .NONE );
507+ (v ._idType != null ) && (v ._idType != Id .NONE )
508+ && (v ._inclusionType != As .NOTHING );
497509 }
498510
499511 /*
0 commit comments