OpenMediaVault
3.0 (Erasmus)
The open network attached storage solution
|
Public Member Functions | |
__construct ($schema) | |
addProperty ($path, array $schema=array()) | |
removeProperty ($path) | |
getAssoc () | |
getAssocByPath ($name) | |
validate ($value, $name="") | |
Protected Member Functions | |
validateType ($value, $schema, $name) | |
validateAny ($value, $schema, $name) | |
validateBoolean ($value, $schema, $name) | |
validateInteger ($value, $schema, $name) | |
validateNumber ($value, $schema, $name) | |
validateString ($value, $schema, $name) | |
validateArray ($value, $schema, $name) | |
validateObject ($value, $schema, $name) | |
validateNull ($value, $schema, $name) | |
checkMinimum ($value, $schema, $name) | |
checkMaximum ($value, $schema, $name) | |
checkExclusiveMinimum ($value, $schema, $name) | |
checkExclusiveMaximum ($value, $schema, $name) | |
checkMinLength ($value, $schema, $name) | |
checkMaxLength ($value, $schema, $name) | |
checkPattern ($value, $schema, $name) | |
checkFormat ($value, $schema, $name) | |
checkEnum ($value, $schema, $name) | |
checkMinItems ($value, $schema, $name) | |
checkMaxItems ($value, $schema, $name) | |
checkProperties ($value, $schema, $name) | |
checkItems ($value, $schema, $name) | |
checkOneOf ($value, $schema, $name) | |
Implements a JSON schema validator.
OMV\Json\Schema::__construct | ( | $schema | ) |
schema | The schema as associative array in JSON schema syntax. |
OMV\Json\Schema::addProperty | ( | $path, | |
array | $schema = array() |
||
) |
Add a new property to the schema at runtime.
path | The path of the property, e.g. "aaa.bbb.ccc", where 'ccc' is the name of the property to add. |
schema | The schema of the property to add, e.g. array("type" => "integer", "default" => 100) |
|
protected |
|
final |
Returns the JSON schema.
|
final |
Returns the JSON schema by the given path.
OMV\Json\Schema::removeProperty | ( | $path | ) |
Remove a property from the schema at runtime.
path | The path of the property to remove. |
|
final |
Validate the given value.
value | The value to validate. |
name | The JSON path of the entity to validate, e.g. 'aa.bb.cc', defaults to an empty string. Use an empty value for the root. |