TypeRule class final
Validates the Dart runtime type of a value against a JSON Schema type.
Supports both the string form ("type": "string") and the array form
("type": ["string", "null"]) as required by JSON Schema spec ยง6.1.1.
In the array form the value is valid if it matches any of the listed
types (logical OR).
- Inheritance
-
- Object
- SchemaRule
- TypeRule
Constructors
- TypeRule(String type)
-
Creates a rule that accepts a single
typestring. -
TypeRule.fromList(List<
String> types) -
Creates a rule that accepts any of
types(array form).
Properties
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