DependentRequiredRule class final
Validates conditional property dependencies in an object (map).
Corresponds to dependentRequired in JSON Schema spec §6.5.4. Each entry
in dependencies maps a trigger property name to a list of property names
that must also be present whenever the trigger is present. If the trigger
is absent, no validation is performed for that entry.
Non-map instances are silently skipped. One SchemaViolation is emitted per missing dependent property, with the path pointing at the missing property name (consistent with RequiredRule).
- Inheritance
-
- Object
- SchemaRule
- DependentRequiredRule
Constructors
-
DependentRequiredRule(Map<
String, List< dependencies)String> > -
Creates a rule from a dependency map.
const
Properties
-
dependencies
→ Map<
String, List< String> > -
The dependency map: trigger → required dependents.
final
- 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