PHPackages                             league/json-guard - 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. league/json-guard

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

league/json-guard
=================

A validator for JSON using json-schema.

1.0.1(9y ago)1832.0M—9.3%27[8 issues](https://github.com/thephpleague/json-guard/issues)[1 PRs](https://github.com/thephpleague/json-guard/pulls)20MITPHPPHP &gt;=5.6.0

Since Apr 15Pushed 8y agoCompare

[ Source](https://github.com/thephpleague/json-guard)[ Packagist](https://packagist.org/packages/league/json-guard)[ Docs](https://github.com/thephpleague/json-guard)[ RSS](/packages/league-json-guard/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (16)Used By (20)

JSON Guard
==========

[](#json-guard)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/fba8d2c64ba4485ca781a1ee33f7615d1e74f675ba6e904746d222dce7e49b5a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f6a736f6e2d67756172642f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/thephpleague/json-guard)[![Coverage Status](https://camo.githubusercontent.com/fd4e04e26f220a53b90508ad3413e987cd14c427412375ca74d681c36a26d1d1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7468657068706c65616775652f6a736f6e2d67756172642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/json-guard/code-structure)[![Quality Score](https://camo.githubusercontent.com/0fa59e2a9377e496fdb6ac85a923bfa85617ee4a205ee9e8022faf783c5e39b9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f6a736f6e2d67756172642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/json-guard)[![Documentation](https://camo.githubusercontent.com/16ee0df28d58259503825d407ff718c07112b5f956409840668d1efc7ddce4ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63732d4c61746573742d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://json-guard.thephpleague.com/)

Unmaintained!
=============

[](#unmaintained)

This project is no longer maintained. Recommended alternatives:

- [opis/json-schema](https://github.com/opis/json-schema)
- [swaggest/php-json-schema](https://github.com/swaggest/php-json-schema)

---

This package is a validator for [JSON Schema](http://json-schema.org/). It fully supports draft 4 of the specification.

Notable Features:

- Passes the entire [draft 4 JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite).
- Fully customizable with custom rule sets.
- Helpful error messages with JSON Pointers.

Install
-------

[](#install)

### Via Composer

[](#via-composer)

```
composer require league/json-guard
```

Usage
-----

[](#usage)

Complete documentation is available [here](http://json-guard.thephpleague.com/).

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information about what has changed recently.

Testing
-------

[](#testing)

You need to run a web server while testing.

```
$ composer test-server
```

Once the server is running, you can run the test suite.

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Matt Allan](https://github.com/thephpleague)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity57

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor5

5 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~12 days

Total

15

Last Release

3347d ago

Major Versions

0.5.2 → 1.0.0-alpha2017-04-24

PHP version history (2 changes)v0.1.0PHP &gt;=5.5.0

1.0.0-alphaPHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/534693?v=4)[Frank de Jonge](/maintainers/frankdejonge)[@frankdejonge](https://github.com/frankdejonge)

![](https://avatars.githubusercontent.com/u/9440455?v=4)[Matt A](/maintainers/matt-allan)[@matt-allan](https://github.com/matt-allan)

---

Top Contributors

[![peterpostmann](https://avatars.githubusercontent.com/u/9541377?v=4)](https://github.com/peterpostmann "peterpostmann (2 commits)")[![ribeiropaulor](https://avatars.githubusercontent.com/u/376830?v=4)](https://github.com/ribeiropaulor "ribeiropaulor (2 commits)")[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (2 commits)")[![karion](https://avatars.githubusercontent.com/u/1007461?v=4)](https://github.com/karion "karion (2 commits)")[![marcioAlmada](https://avatars.githubusercontent.com/u/227395?v=4)](https://github.com/marcioAlmada "marcioAlmada (1 commits)")[![msarca](https://avatars.githubusercontent.com/u/5808737?v=4)](https://github.com/msarca "msarca (1 commits)")[![Orkin](https://avatars.githubusercontent.com/u/1061903?v=4)](https://github.com/Orkin "Orkin (1 commits)")[![rodnover55](https://avatars.githubusercontent.com/u/2125064?v=4)](https://github.com/rodnover55 "rodnover55 (1 commits)")[![aejnsn](https://avatars.githubusercontent.com/u/5347897?v=4)](https://github.com/aejnsn "aejnsn (1 commits)")[![ZeljkaBlazek](https://avatars.githubusercontent.com/u/32762399?v=4)](https://github.com/ZeljkaBlazek "ZeljkaBlazek (1 commits)")[![CaporalDead](https://avatars.githubusercontent.com/u/1705597?v=4)](https://github.com/CaporalDead "CaporalDead (1 commits)")[![gbirke](https://avatars.githubusercontent.com/u/223326?v=4)](https://github.com/gbirke "gbirke (1 commits)")[![leberknecht](https://avatars.githubusercontent.com/u/1165177?v=4)](https://github.com/leberknecht "leberknecht (1 commits)")

---

Tags

json-schemajsonschemavalidationjson-schemajson-schema.org

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/league-json-guard/health.svg)

```
[![Health](https://phpackages.com/badges/league-json-guard/health.svg)](https://phpackages.com/packages/league-json-guard)
```

###  Alternatives

[opis/json-schema

Json Schema Validator for PHP

65243.6M300](/packages/opis-json-schema)[geraintluff/jsv4

A (coercive) JSON Schema v4 Validator for PHP

116465.4k4](/packages/geraintluff-jsv4)[romaricdrigon/metayaml

Using \[Yaml|Xml|json\] schemas files to validate \[Yaml|Xml|json\]

103312.7k8](/packages/romaricdrigon-metayaml)[evaisse/php-json-schema-generator

A JSON Schema Generator.

20316.0k1](/packages/evaisse-php-json-schema-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
