2017 © Pedro Peláez
 

library json-schema-validator

PHP 5.3 implementation of json schema validation

image

hasbridge/json-schema-validator

PHP 5.3 implementation of json schema validation

  • Friday, January 9, 2015
  • by hasbridge
  • Repository
  • 18 Watchers
  • 128 Stars
  • 244,593 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 38 Forks
  • 15 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Requirements

  • PHP 5.3 or greater (requires namespace and closure support)

Usage

$someJson = '{"foo":"bar"}';
$jsonObject = json_decode($someJson);

$validator = new JsonValidator('/path/to/yourschema.json');

$validator->validate($jsonObject);

Supported Types

Types may be defined as either a single string type name, or an array of allowable type names., (*1)

  • string
  • number
  • integer
  • boolean
  • object
  • array
  • null
  • any

Supported Definitions

Not all definitions are yet supported, but here is a list of those which are:, (*2)

  • properties (object)
  • additionalProperties (object)
  • required (all)
  • pattern (string)
  • minLength (string)
  • maxLength (string)
  • format (string, number, integer)
  • minimum (number, integer)
  • maximum (number, integer)
  • exclusiveMinimum (number, integer)
  • exclusiveMaximum (number, integer)
  • divisibleBy (number, integer)
  • enum (array)
  • minItems (array)
  • maxItems (array)
  • uniqueItems (array)
  • items (array)
  • disallow (all)

The following definitions are not yet supported:, (*3)

  • patternProperties
  • dependencies
  • extends
  • id
  • $ref
  • $schema

The Versions

09/01 2015

dev-master

9999999-dev https://github.com/hasbridge/php-json-schema

PHP 5.3 implementation of json schema validation

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Harold Asbridge

schema json

27/02 2012

0.2.0

0.2.0.0 https://github.com/hasbridge/php-json-schema

PHP 5.3 implementation of json schema validation

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Harold Asbridge

schema json

24/01 2012

0.1.0

0.1.0.0

PHP 5.3 implementation of json schema validation

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Harold Asbridge

schema json