class

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.

Source
disable_additional_items

Set the constraint that the array does not allow additional items beyond those specified in prefix_items. See Additional Items.

Source
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
Source
max_contains(value : Int32)

Set the max_contains. See Contains.

Source
max_items(value : Int32)

Set the max_items. See Length

Source
min_contains(value : Int32)

Set the min_contains. See Contains.

Source
min_items(value : Int32)

Set the min_items. See Length

Source
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
Source
unique_items

Sets the uniqueness constraint on items in the array.

Source
validator
Source