2017 © Pedro PelĂĄez
 

library jval

JSON Schema validator

image

stefk/jval

JSON Schema validator

  • Sunday, July 9, 2017
  • by stefk
  • Repository
  • 3 Watchers
  • 14 Stars
  • 64,460 Installations
  • PHP
  • 5 Dependents
  • 1 Suggesters
  • 3 Forks
  • 4 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

JVal

A JSON Schema validator written in PHP., (*1)

Features:, (*2)

  • Full draft 4 support (passes the whole official [test suite] (https://github.com/json-schema/JSON-Schema-Test-Suite), except for the two tests that require big nums to be treated as integers, which is not feasible in PHP)
  • Distinct steps for references resolution, syntax parsing and data validation.

Build Status Code Coverage Scrutinizer Code Quality, (*3)

Installation

composer require stefk/jval dev-master, (*4)

Basic usage

$validator = JVal\Validator::buildDefault();
$violations = $validator->validate($data, $schema);

Data can be anything that might result from a call to json_decode. The schema must be the JSON-decoded representation of a JSON Schema, i.e. a stdClass instance., (*5)

If the schema contains relative references to external schemas (either remote or local), the absolute URI of the base schema will probably be needed as well:, (*6)

$validator = JVal\Validator::buildDefault();
$violations = $validator->validate($data, $schema, 'file://path/to/the/schema');

CLI

bin/jval path/to/data path/to/schema

The Versions

09/07 2017

dev-latest-spec

dev-latest-spec https://github.com/stefk/JVal

JSON Schema validator

  Sources   Download

MIT

The Requires

  • php >=5.4.1
  • ext-mbstring *

 

The Development Requires

by Stéphane Klein

json validation json schema

25/09 2016

dev-master

9999999-dev https://github.com/stefk/JVal

JSON Schema validator

  Sources   Download

MIT

The Requires

  • php >=5.4.1
  • ext-mbstring *

 

The Development Requires

by Stéphane Klein

json validation json schema