PHPackages                             ergebnis/json-schema-validator - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. ergebnis/json-schema-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

ergebnis/json-schema-validator
==============================

Provides a JSON schema validator, building on top of justinrainbow/json-schema.

4.5.1(8mo ago)3626.9M—7.4%[1 issues](https://github.com/ergebnis/json-schema-validator/issues)[3 PRs](https://github.com/ergebnis/json-schema-validator/pulls)6MITPHPPHP ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Feb 2Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ergebnis/json-schema-validator)[ Packagist](https://packagist.org/packages/ergebnis/json-schema-validator)[ Docs](https://github.com/ergebnis/json-schema-validator)[ RSS](/packages/ergebnis-json-schema-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (18)Used By (6)

json-schema-validator
=====================

[](#json-schema-validator)

[![Integrate](https://github.com/ergebnis/json-schema-validator/workflows/Integrate/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)[![Merge](https://github.com/ergebnis/json-schema-validator/workflows/Merge/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)[![Release](https://github.com/ergebnis/json-schema-validator/workflows/Release/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)[![Renew](https://github.com/ergebnis/json-schema-validator/workflows/Renew/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)

[![Code Coverage](https://camo.githubusercontent.com/158028f1c7bc008ca9375803741704963adc412b925658d9995d21b04496a1bc/68747470733a2f2f636f6465636f762e696f2f67682f65726765626e69732f6a736f6e2d736368656d612d76616c696461746f722f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/ergebnis/json-schema-validator)

[![Latest Stable Version](https://camo.githubusercontent.com/3587de714a9e528d5c7ceea26623b467d2d8fe7aa2d6cf94fa0bf8eb12bbf71f/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f6a736f6e2d736368656d612d76616c696461746f722f762f737461626c65)](https://packagist.org/packages/ergebnis/json-schema-validator)[![Total Downloads](https://camo.githubusercontent.com/027afbcf671b01c7cc00a1c3112c7d1b765b47dff50e164e6213250250742cf1/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f6a736f6e2d736368656d612d76616c696461746f722f646f776e6c6f616473)](https://packagist.org/packages/ergebnis/json-schema-validator)[![Monthly Downloads](https://camo.githubusercontent.com/dd7bf80ac48127a9064a7ecfd351e5163de8978e13a43bcecc068a1ce88575ee/687474703a2f2f706f7365722e707567782e6f72672f65726765626e69732f6a736f6e2d736368656d612d76616c696461746f722f642f6d6f6e74686c79)](https://packagist.org/packages/ergebnis/json-schema-validator)

This project provides a [`composer`](https://getcomposer.org) package with a JSON schema validator, building on top of [`justinrainbow/json-schema`](https://github.com/justinrainbow/json-schema).

Installation
------------

[](#installation)

Run

```
composer require ergebnis/json-schema-validator
```

Usage
-----

[](#usage)

If you have used the validator from `justinrainbow/json-schema` before, you might have observed that it has a few flaws:

- The validator is stateful.
- The validator requires decoding JSON strings before validating them.
- The validator returns an `array` of errors, where each error is an `array`.

This package delegates the validation to `justinrainbow/json-schema` and provides a friendlier interface.

```
