UniqueItemsRule class final
Validates that all elements in an array are pairwise distinct.
Corresponds to uniqueItems: true in JSON Schema spec §6.4.3. When
uniqueItems is false (or absent) no validation is performed.
Non-array instances are silently skipped.
Uses an O(n²) pairwise DeepCollectionEquality comparison so that nested
List and Map elements are compared by structural value rather than by
reference. A plain toSet() check would fail to detect duplicate nested
objects.
- Inheritance
-
- Object
- SchemaRule
- UniqueItemsRule
Constructors
- UniqueItemsRule()
-
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
-
validate(
dynamic value, String path) → List< SchemaViolation> -
Validates
valueatpathand returns every violation found.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited