AdditionalPropertiesSchemaRule class final

Validates properties not covered by properties or patternProperties against a sub-schema.

Corresponds to a schema-valued additionalProperties in JSON Schema spec ยง6.5.6. Properties whose names are in declaredKeys or match any regex in patternRegexes are considered "evaluated" and are skipped. All remaining properties are validated against schema.

Non-object instances are silently skipped (no violation).

This complements AdditionalPropertiesRule (which uses false to reject extra properties outright). When additionalProperties is a schema, this rule is emitted instead.

Inheritance

Constructors

AdditionalPropertiesSchemaRule({required SchemaRule schema, required Set<String> declaredKeys, required List<RegExp> patternRegexes})
Creates a rule that applies schema to every non-evaluated property.
const

Properties

declaredKeys Set<String>
Keys explicitly declared under properties.
final
hashCode int
The hash code for this object.
no setterinherited
patternRegexes List<RegExp>
Compiled regexes from patternProperties used to identify pattern-matched keys.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema SchemaRule
The sub-schema applied to each additional property value.
final

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