module JSONSchema::FluentValidatorGenericProperties

Overview

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

Direct including types

Defined in:

fluent.cr

Instance Method Summary

Instance Method Detail

def 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.


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


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

[View source]
def not(*children) #

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


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


[View source]