2017 © Pedro PelĂĄez
 

library json-schema

A library to validate a json schema.

image

folha/json-schema

A library to validate a json schema.

  • Friday, July 1, 2016
  • by Webysther
  • Repository
  • 7 Watchers
  • 0 Stars
  • 142 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 259 Forks
  • 0 Open issues
  • 21 Versions
  • 0 % Grown

The README.md

JSON Schema for PHP

Build Status Latest Stable Version Total Downloads, (*1)

A PHP Implementation for validating JSON Structures against a given Schema., (*2)

See json-schema for more details., (*3)

Installation

Library

$ git clone https://github.com/justinrainbow/json-schema.git

Dependencies

Composer (will use the Composer ClassLoader)

$ wget http://getcomposer.org/composer.phar
$ php composer.phar require justinrainbow/json-schema:~1.3

Usage

<?php

// Get the schema and data as objects
$retriever = new JsonSchema\Uri\UriRetriever;
$schema = $retriever->retrieve('file://' . realpath('schema.json'));
$data = json_decode(file_get_contents('data.json'));

// If you use $ref or if you are unsure, resolve those references here
// This modifies the $schema object
$refResolver = new JsonSchema\RefResolver($retriever);
$refResolver->resolve($schema, 'file://' . __DIR__);

// Validate
$validator = new JsonSchema\Validator();
$validator->check($data, $schema);

if ($validator->isValid()) {
    echo "The supplied JSON validates against the schema.\n";
} else {
    echo "JSON does not validate. Violations:\n";
    foreach ($validator->getErrors() as $error) {
        echo sprintf("[%s] %s\n", $error['property'], $error['message']);
    }
}

Running the tests

$ vendor/bin/phpunit

The Versions

01/07 2016

dev-master

9999999-dev https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

22/12 2015

dev-fix/mediatype-json-only

dev-fix/mediatype-json-only https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

09/09 2015

1.5.0

1.5.0.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

14/07 2015

1.4.4

1.4.4.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

13/07 2015

1.4.3

1.4.3.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

14/06 2015

1.4.2

1.4.2.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

27/03 2015

1.4.1

1.4.1.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

23/03 2015

1.4.0

1.4.0.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

25/08 2014

1.3.7

1.3.7.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

05/03 2014

1.3.6

1.3.6.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

13/12 2013

1.3.5

1.3.5.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

08/12 2013

1.3.4

1.3.4.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

22/07 2013

1.3.3

1.3.3.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

10/06 2013

1.3.2

1.3.2.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Bruno Prieto Reis
by Justin Rainbow

schema json

21/02 2013

1.3.1

1.3.1.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Bruno Prieto Reis
by Justin Rainbow

schema json

18/02 2013

1.3.0

1.3.0.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Bruno Prieto Reis
by Justin Rainbow

schema json

31/01 2013

1.2.4

1.2.4.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Bruno Prieto Reis
by Justin Rainbow

schema json

29/01 2013

1.2.3

1.2.3.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Bruno Prieto Reis
by Justin Rainbow

schema json

18/08 2012

1.2.1

1.2.1.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Bruno Prieto Reis
by Justin Rainbow

schema json

04/06 2012

dev-schema-builder

dev-schema-builder https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

BSD-3-Clause

The Requires

 

by Bruno Prieto Reis
by Justin Rainbow

schema json

03/01 2012

1.1.0

1.1.0.0 https://github.com/justinrainbow/json-schema

A library to validate a json schema.

  Sources   Download

NewBSD

The Requires

  • php >=5.3.0

 

by Bruno Prieto Reis
by Justin Rainbow

schema json