DeserializationFeature enum
Feature flags that influence deserialization behavior in JetLeaf.
These options determine how JSON input is interpreted, validated, and transformed into Dart objects.
Example
final mapper = ObjectMapper()
..enable(DeserializationFeature.ACCEPT_EMPTY_STRINGS_AS_NULL)
..disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
Notes
- Features provide compatibility and fault-tolerance for varying JSON formats.
- Most options mirror Jackson’s configuration model for familiarity.
See also
Values
- FAIL_ON_UNKNOWN_PROPERTIES → const DeserializationFeature
-
Throws an error when encountering unknown JSON properties that do not map to any field in the target class.
- ALLOW_COMMENTS → const DeserializationFeature
-
Allows
//and/* */comments inside JSON documents.Non-standard, but useful for configuration files or relaxed parsing.
- ALLOW_SINGLE_QUOTES → const DeserializationFeature
-
Permits the use of single quotes (
'value') for strings in addition to standard double quotes. - FAIL_ON_MISSING_CREATOR_PROPERTIES → const DeserializationFeature
-
Fails when a required constructor or factory parameter (creator property) is missing from input JSON.
- ACCEPT_EMPTY_STRINGS_AS_NULL → const DeserializationFeature
-
Interprets empty strings (
"") asnullfor non-string fields.Example:
{ "user": "" } → { "user": null } - ADJUST_DATES_TO_CONTEXT_TIME_ZONE → const DeserializationFeature
-
Adjusts parsed
DateTimevalues to the context’s configured time zone (see ObjectMapper.TIMEZONE_PROPERTY).
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
DeserializationFeature> - A constant List of the values in this enum, in order of their declaration.