ArrayRule class final
Validates array length and per-element schema constraints.
When prefixItems is present in a schema, items must only apply to
elements beyond the prefix. The itemsStartIndex parameter controls this:
the items schema is applied only to elements at indices ≥
itemsStartIndex. When itemsStartIndex is 0 (the default, used when no
prefixItems is present), items applies uniformly to all elements, which
is the pre-2020-12 behaviour.
- Inheritance
-
- Object
- SchemaRule
- ArrayRule
Constructors
- ArrayRule({int? minItems, int? maxItems, SchemaRule? items, int itemsStartIndex = 0})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- items → SchemaRule?
-
Schema applied to elements at indices ≥ itemsStartIndex.
final
- itemsStartIndex → int
-
The first index at which items applies.
final
- maxItems → int?
-
final
- minItems → int?
-
final
- 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