Violation class

Represents a single contract violation found during validation.

Each violation includes the field path in dot notation (e.g. "user.address.city"), the type of violation, and a human-readable message.

Constructors

Violation({required String fieldPath, required ViolationType type, required String message, dynamic expectedValue, dynamic actualValue})
Creates a new Violation.
const

Properties

actualValue → dynamic
The actual value or type found in the response.
final
expectedValue → dynamic
The expected value or type for this field.
final
fieldPath String
The dot-notation path to the field that caused the violation.
final
hashCode int
The hash code for this object.
no setterinherited
message String
A human-readable description of the violation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type ViolationType
The type of violation detected.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited