JsonIgnore class

Leaves a property out of JSON in both directions.

Use it for data that must never leave the server or come from a client, such as a password hash or an internal flag. The property is not written, and a JSON property of that name is skipped when reading.

// Stored, but never part of an API response.
@JsonIgnore()
String? passwordHash;

Spring (Java):

@JsonIgnore String passwordHash;

Constructors

JsonIgnore()
Leaves the annotated property out of JSON.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
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