# Json

class Json

JSON Schema Validator

Implements schema draft version 03, as defined at http://json-schema.org

## Properties

protected | $schemaDefinition |  |
protected stdClass | $schema |  |

## Methods

__construct(string $schemaFile)

Initialize validation object

Json
validate(mixed $entity, string $entityName = null)

Validate schema object

Json
checkFormat(mixed $entity, object $schema, string $entityName)

Check format restriction

Json
validateProperties(object $entity, object $schema, string $entityName)

Validate object properties

Json
validateType(mixed $entity, object $schema, string $entityName)

Validate entity type

Json
checkTypeObject(mixed $entity, object $schema, string $entityName)

Check object type

Json
checkTypeNumber(mixed $entity, object $schema, string $entityName)

Check number type

Json
checkTypeInteger(mixed $entity, object $schema, string $entityName)

Check integer type

Json
checkTypeBoolean(mixed $entity, object $schema, string $entityName)

Check boolean type

Json
checkTypeString(mixed $entity, object $schema, string $entityName)

Check string type

Json
checkTypeArray(mixed $entity, object $schema, string $entityName)

Check array type

Json
checkTypeNull(mixed $entity, object $schema, string $entityName)

Check null type

Json
checkTypeAny(mixed $entity, object $schema, string $entityName)

Check any type

Json
checkMinimum(int|float $entity, object $schema, string $entityName)

Check minimum value

Json
checkMaximum(int|float $entity, object $schema, string $entityName)

Check maximum value

Json
checkExclusiveMinimum(int|float $entity, object $schema, string $entityName)

Check exlusive minimum requirement

Json
checkExclusiveMaximum(int|float $entity, object $schema, string $entityName)

Check exclusive maximum requirement

Json
checkPattern(string $entity, object $schema, string $entityName)

Check value against regex pattern

Json
checkMinLength(string $entity, object $schema, string $entityName)

Check string minimum length

Json
checkMaxLength(string $entity, object $schema, string $entityName)

Check string maximum length

Json
checkMinItems(array $entity, object $schema, string $entityName)

Check array minimum items

Json
checkMaxItems(array $entity, object $schema, string $entityName)

Check array maximum items

Json
checkUniqueItems(array $entity, object $schema, string $entityName)

Check array unique items

Json
checkEnum(array $entity, object $schema, string $entityName)

Check enum restriction

Json
checkItems(array $entity, object $schema, string $entityName)

Check items restriction

Json
checkDisallow(mixed $entity, object $schema, string $entityName)

Check disallowed entity type

Json
checkDivisibleBy(int|float $entity, object $schema, string $entityName)

Check divisibleby restriction

## Details

###
at line 56
`__construct(string $schemaFile)`

Initialize validation object

#### Parameters

string | $schemaFile |

###
at line 80
`Json validate(mixed $entity, string $entityName = null)`

Validate schema object

#### Parameters

mixed | $entity |
string | $entityName |

#### Return Value

Json |

###
at line 99
`Json checkFormat(mixed $entity, object $schema, string $entityName)`

Check format restriction

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 185
`protected Json validateProperties(object $entity, object $schema, string $entityName)`

Validate object properties

#### Parameters

object | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 229
`protected Json validateType(mixed $entity, object $schema, string $entityName)`

Validate entity type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 318
`protected Json checkTypeObject(mixed $entity, object $schema, string $entityName)`

Check object type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 334
`protected Json checkTypeNumber(mixed $entity, object $schema, string $entityName)`

Check number type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 357
`protected Json checkTypeInteger(mixed $entity, object $schema, string $entityName)`

Check integer type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 380
`protected Json checkTypeBoolean(mixed $entity, object $schema, string $entityName)`

Check boolean type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 394
`protected Json checkTypeString(mixed $entity, object $schema, string $entityName)`

Check string type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 415
`protected Json checkTypeArray(mixed $entity, object $schema, string $entityName)`

Check array type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 436
`protected Json checkTypeNull(mixed $entity, object $schema, string $entityName)`

Check null type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 450
`protected Json checkTypeAny(mixed $entity, object $schema, string $entityName)`

Check any type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 466
`protected Json checkMinimum(int|float $entity, object $schema, string $entityName)`

Check minimum value

#### Parameters

int|float | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 486
`protected Json checkMaximum(int|float $entity, object $schema, string $entityName)`

Check maximum value

#### Parameters

int|float | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 506
`protected Json checkExclusiveMinimum(int|float $entity, object $schema, string $entityName)`

Check exlusive minimum requirement

#### Parameters

int|float | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 526
`protected Json checkExclusiveMaximum(int|float $entity, object $schema, string $entityName)`

Check exclusive maximum requirement

#### Parameters

int|float | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 546
`protected Json checkPattern(string $entity, object $schema, string $entityName)`

Check value against regex pattern

#### Parameters

string | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 566
`protected Json checkMinLength(string $entity, object $schema, string $entityName)`

Check string minimum length

#### Parameters

string | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 586
`protected Json checkMaxLength(string $entity, object $schema, string $entityName)`

Check string maximum length

#### Parameters

string | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 606
`protected Json checkMinItems(array $entity, object $schema, string $entityName)`

Check array minimum items

#### Parameters

array | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 626
`protected Json checkMaxItems(array $entity, object $schema, string $entityName)`

Check array maximum items

#### Parameters

array | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 646
`protected Json checkUniqueItems(array $entity, object $schema, string $entityName)`

Check array unique items

#### Parameters

array | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 666
`protected Json checkEnum(array $entity, object $schema, string $entityName)`

Check enum restriction

#### Parameters

array | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 702
`protected Json checkItems(array $entity, object $schema, string $entityName)`

Check items restriction

#### Parameters

array | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 753
`protected Json checkDisallow(mixed $entity, object $schema, string $entityName)`

Check disallowed entity type

#### Parameters

mixed | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |

###
at line 790
`protected Json checkDivisibleBy(int|float $entity, object $schema, string $entityName)`

Check divisibleby restriction

#### Parameters

int|float | $entity |
object | $schema |
string | $entityName |

#### Return Value

Json |