PHPackages                             stefk/jval - 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. stefk/jval

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

stefk/jval
==========

JSON Schema validator

16292.3k↓44.7%6[3 issues](https://github.com/stefk/JVal/issues)[1 PRs](https://github.com/stefk/JVal/pulls)3PHP

Since Jul 9Pushed 1y ago3 watchersCompare

[ Source](https://github.com/stefk/JVal)[ Packagist](https://packagist.org/packages/stefk/jval)[ RSS](/packages/stefk-jval/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (3)

JVal
====

[](#jval)

A [JSON Schema](http://json-schema.org) validator written in PHP.

Features:

- Full draft 4 support (passes the whole official \[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](https://camo.githubusercontent.com/059ad1ddd75bd19015449a0e6df8287d220a8f9edf5ffc60274d58472e8c9760/68747470733a2f2f7472617669732d63692e6f72672f737465666b2f4a56616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/stefk/JVal)[![Code Coverage](https://camo.githubusercontent.com/b9f34316cbf07300f9aa21aeab2856223e8005570ec3a593c45414596b28a7ba/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f737465666b2f4a56616c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/stefk/JVal/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cc5db874431f50498de9020d4c3906f14e71dbe972881eef712356ced8137c46/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f737465666b2f4a56616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/stefk/JVal/?branch=master)

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

[](#installation)

`composer require stefk/jval dev-master`

Basic usage
-----------

[](#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.

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:

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

CLI
---

[](#cli)

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

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e3b554887f1d89617b1736b1c87c67168074bc6e89f1ec0612e306cf648543e?d=identicon)[stefk](/maintainers/stefk)

---

Top Contributors

[![stefk](https://avatars.githubusercontent.com/u/880921?v=4)](https://github.com/stefk "stefk (121 commits)")[![JanTvrdik](https://avatars.githubusercontent.com/u/175109?v=4)](https://github.com/JanTvrdik "JanTvrdik (11 commits)")[![kasperdf](https://avatars.githubusercontent.com/u/87651289?v=4)](https://github.com/kasperdf "kasperdf (1 commits)")

---

Tags

json-schemaphpvalidator

### Embed Badge

![Health badge](/badges/stefk-jval/health.svg)

```
[![Health](https://phpackages.com/badges/stefk-jval/health.svg)](https://phpackages.com/packages/stefk-jval)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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