module

JSONSchema::FluentValidatorGenericProperties

Contains fluent methods for interfacing with generic json-schema properties such as enum and composite schemas.

Instance methods

all_of(*children)

Constraint that all of the passed schemas must be valid given the input JSON. Accepts any number of children as JSONSchema::Validator objects.

Source
any_of(*children)

Constraint that at least one of the passed schemas must be valid given the input JSON. Accepts any number of children as JSONSchema::Validator objects.

Source
enum_list(*values)

Set a list of values that are allowed for this schema. This method is not called enum to avoid conflicting with the enum keyword.

validator = JSONSchema.generic do
  enum_list "one", "two", "three"
end
Source
not(*children)

Constraint that the passed schema is not valid given the input JSON. Accepts any number of children as JSONSchema::Validator objects.

Source
one_of(*children)

Constraint that only one of the passed schemas is valid given the input JSON. Accepts any number of children as JSONSchema::Validator objects.

Source