ObjectSizeRule class final

Validates the number of properties in an object (map).

Covers both minProperties (spec §6.5.2) and maxProperties (spec §6.5.1). Non-map instances are silently skipped. Either bound may be null to indicate no constraint in that direction.

Inheritance

Constructors

ObjectSizeRule({int? minProperties, int? maxProperties})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
maxProperties int?
Inclusive maximum number of properties, or null for no upper bound.
final
minProperties int?
Inclusive minimum number of properties, or null for no lower bound.
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 value at path and returns every violation found.
override

Operators

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