JSONSchema::FluentArrayValidator
Inherits JSONSchema::FluentValidatorGenericProperties / Reference / Object
A fluent API for creating instances of JSONSchema::ArrayValidator.
Instance methods
contains(v : Validator)
Set the validator to check that at least one item matches the schema. See Contains.
disable_additional_items
Set the constraint that the array does not allow additional items beyond those specified in prefix_items.
See Additional Items.
items(v : Validator)
Set a validator for items in the array. See Items.
js = JSONSchema.fluent
validator = js.array do
items js.string { min_length 10 }
end
prefix_items(*validators)
Set validators for Tuple validation of the array. See Tuple validation.
js = JSONSchema.fluent
validator = js.array do
prefix_items(
js.number,
js.string,
js.string
)
end
validator
Source