class JSONSchema::FluentArrayValidator
- JSONSchema::FluentArrayValidator
- Reference
- Object
Overview
A fluent API for creating instances of JSONSchema::ArrayValidator
.
Included Modules
Defined in:
fluent.crInstance Method Summary
-
#contains(v : Validator)
Set the validator to check that at least one item matches the schema.
-
#disable_additional_items
Set the constraint that the array does not allow additional items beyond those specified in
#prefix_items
. -
#items(v : Validator)
Set a validator for items in the array.
-
#max_contains(value : Int32)
Set the
#max_contains
. -
#max_items(value : Int32)
Set the
#max_items
. -
#min_contains(value : Int32)
Set the
#min_contains
. -
#min_items(value : Int32)
Set the
#min_items
. -
#prefix_items(*validators)
Set validators for Tuple validation of the array.
-
#unique_items
Sets the uniqueness constraint on items in the array.
- #validator : JSONSchema::ArrayValidator
Instance methods inherited from module JSONSchema::FluentValidatorGenericProperties
all_of(*children)
all_of,
any_of(*children)
any_of,
enum_list(*values)
enum_list,
not(*children)
not,
one_of(*children)
one_of
Instance Method Detail
Set the validator to check that at least one item matches the schema. See Contains.
Set the constraint that the array does not allow additional items beyond those specified in #prefix_items
.
See Additional Items.
Set a validator for items in the array. See Items.
js = JSONSchema.fluent
validator = js.array do
items js.string { min_length 10 }
end
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