Download the PHP package systopia/opis-json-schema-ext without Composer
On this page you can find all versions of the php package systopia/opis-json-schema-ext. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download systopia/opis-json-schema-ext
More information about systopia/opis-json-schema-ext
Files in systopia/opis-json-schema-ext
Package opis-json-schema-ext
Short Description Extension for Opis JSON Schema
License Apache-2.0
Homepage https://github.com/systopia/opis-json-schema-ext
Informations about the package opis-json-schema-ext
Systopia Opis JSON Schema Extension
This is an extension for Opis JSON Schema.
Keywords
The following additional keywords are provided:
$calculate
evaluate
maxDate
minDate
noIntersect
An array must not contain intersecting intervals.$order
Order arrays. (Only performed, if array has no violations.)precision
$tag
Tagged data can be fetched from a data container after validation.$validations
See tests for how to use them.
The SystopiaValidator
already provides those
keywords. To use them in a different validator class you might want to use
SystopiaSchemaParser
or
SystopiaVocabulary
.
Empty array to object conversion
If the option convertEmptyArrays
is set to true
(disabled by default), empty
arrays will be converted to objects if the schema type contains object
, but
not array
. This might be necessary if the data to validate was already
decoded.
Translation
This extension allows to translate ValidationError
s:
First create an instance of TranslatorInterface
:
If there is a localisation in the messages
directory you can use:
Then create an instance of ErrorTranslator
:
Let the ErrorTranslator
translate a validation error: