CustomKeyword class
A class to contain the set of functions for setting and validating keywords in a custom vocabulary.
The two functions provided are used to process an attribute in a schema and then validate data.
The setter function takes the current JsonSchema node being processed and the data from the json. The given function should validate and transform the data however is needed for the corresponding validation function. If the data is bad a FormatException with a clear message should be thrown.
The validation function takes the output from the property setter and data from a JSON payload to be validated.
A CustomValidationResult
should be returned to indicate the outcome of the validation.
Constructors
- CustomKeyword(Object propertySetter(JsonSchema schema, Object? value), ValidationContext validator(ValidationContext context, Object schemaProperty, Object instanceData))
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- propertySetter → Object Function(JsonSchema schema, Object? value)
-
Function used to set a property from the a schema.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- validator → ValidationContext Function(ValidationContext context, Object schemaProperty, Object instanceData)
-
Function used to validate a json 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited