class JSONSchema::FluentArrayValidator

Overview

A fluent API for creating instances of JSONSchema::ArrayValidator.

Included Modules

Defined in:

fluent.cr

Instance Method Summary

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

def contains(v : Validator) #

Set the validator to check that at least one item matches the schema. See Contains.


[View source]
def disable_additional_items #

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


[View source]
def 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

[View source]
def max_contains(value : Int32) #

Set the #max_contains. See Contains.


[View source]
def max_items(value : Int32) #

Set the #max_items. See Length


[View source]
def min_contains(value : Int32) #

Set the #min_contains. See Contains.


[View source]
def min_items(value : Int32) #

Set the #min_items. See Length


[View source]
def 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

[View source]
def unique_items #

Sets the uniqueness constraint on items in the array.


[View source]
def validator : JSONSchema::ArrayValidator #

[View source]