PHPackages                             sgpinkus/jsonschema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sgpinkus/jsonschema

ActiveLibrary

sgpinkus/jsonschema
===================

A PHP JSON Schema validator

v1.5.0(5y ago)411[1 issues](https://github.com/sgpinkus/JsonSchema/issues)GPL-3.0PHPPHP &gt;=7.1CI failing

Since Jan 3Pushed 3y ago2 watchersCompare

[ Source](https://github.com/sgpinkus/JsonSchema)[ Packagist](https://packagist.org/packages/sgpinkus/jsonschema)[ RSS](/packages/sgpinkus-jsonschema/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (13)Used By (0)

Overview [![Build Status](https://camo.githubusercontent.com/867a70097eb37142db7dcda1f86bb50e8d437b425037e0375672caca87c83a8d/68747470733a2f2f6170692e7472617669732d63692e6f72672f736770696e6b75732f4a736f6e536368656d612e706e67)](https://travis-ci.org/sgpinkus/JsonSchema)
=============================================================================================================================================================================================================================================================================

[](#overview-)

Draft v6 compliant JSON Schema validator for PHP:

- Modular design.
- Simple interface for validation.
- JsonRef dereferencing is handled by an external PHP library [JsonRef](http://jsonref.org). You can easily replace it with a different one.
- Easily extensible with custom constraints.
- Draft v4 compatible.

Installation
============

[](#installation)

```
composer install sgpinkus/jsonschema

```

Test
====

[](#test)

```
git clone ... && cd JsonSchema
git submodule update --init
composer test

```

Usage
=====

[](#usage)

In the simplest case, where you have a standalone JSON schema with no `$refs`:

```
