DartFieldModel class final

A DTO field and its JSON rules.

Constructors

DartFieldModel({required String name, required DartTypeReference type, bool isRequired = true, String? wireName, bool acceptsNull = false, bool usePresenceRecord = false, List<Object> discriminatorValues = const [], JsonValue? fixedValue, String? fixedExpression, Set<String> fixedDependencies = const {}, JsonValue? defaultValue, String? defaultExpression, Set<String> defaultDependencies = const {}})
Defines a named parameter. Optional fields need nullability or a default.

Properties

acceptsNull → bool
Whether explicit JSON null is valid.
final
defaultDependencies → Set<String>
Types and imported symbols used by the constant default expression.
final
defaultExpression → String?
Constant Dart expression for defaultValue, allocated by the mapper.
final
defaultValue → JsonValue?
Schema default for an optional field. Null means no default.
final
discriminatorValues → List<Object>
Allowed discriminator enum values. Empty means no enum constraint.
final
fixedDependencies → Set<String>
Named types used by the fixed getter expression.
final
fixedExpression → String?
Constant getter expression for fixedValue.
final
fixedValue → JsonValue?
Fixed discriminator wire value. Null means a caller-supplied field.
final
hashCode → int
The hash code for this object.
no setterinherited
isRequired → bool
Whether the JSON property is required. Fixed fields have no parameter.
final
name → String
Identifier of the generated field.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tracksPresence → bool
Wraps optional nullable JSON values in a presence record.
no setter
type → DartTypeReference
Declared Dart type.
final
usePresenceRecord → bool
Enables presence records for optional nullable fields without defaults.
final
wireName → String?
Original JSON property name.
final

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