SchemaError
s indicate a problem with the schema specified, whereas
ValidationError
s indicate a violation of the schema. Both include a message
,
which is human-readable and contains information for the developer, and a
type
, which is one of the following:
schema_not_found
:$schema
specified was not foundunknown_type
: type specified in the schema is not knownunresolved_references
: reference could not be resolvedloop_detected
: reference loop detectedunresolved_pointer
: pointer in document couldn't be resolvedscheme_not_supported
: lookup of reference over scheme specified isn't supportedinvalid_type
: the schema being parsed is not a valid JSON schema, because a value is the wrong typeunknown_format
: the format specified is not supported by this gem
loop_detected
: validation loop detected - currently this loop detection is disabled as it's too aggressiveinvalid_type
: type supplied is not allowed by the schemainvalid_format
:format
condition not satisfiedinvalid_keys
: some keys of a hash supplied aren't allowedany_of_failed
:anyOf
condition failedall_of_failed
:allOf
condition failedone_of_failed
:oneOf
condition failednot_failed
: input matched thenot
schemamin_length_failed
: input shorter thanminLength
max_length_failed
: input longer thanmaxLength
min_items_failed
: input array smaller thanminItems
max_items_failed
: input array larger thanmaxItems
min_failed
: input value too small (undermin
)max_failed
: input value too large (overmax
)min_properties_failed
: fewer thanminProperties
keys in hashmax_properties_failed
: more thanmaxProperties
keys in hashmultiple_of_failed
: input not a multiple ofmultipleOf
pattern_failed
: input string didn't match regexpattern
required_failed
: somerequired
keys weren't includedunique_items_failed
: array contained duplicates, disallowed by"uniqueItems": true
ValidationError
s from allOf
(only if all_of_sub_errors
is configured as true), anyOf
, and oneOf
will
also populate sub_errors
on the error object. This is an array of arrays, with each sub-array containing the
validation errors for each subschema.