PHPackages                             classic/json-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. classic/json-validator

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

classic/json-validator
======================

Fast and intuitive json validator

00PHP

Since Jul 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ElijahKaftanov/json-validator)[ Packagist](https://packagist.org/packages/classic/json-validator)[ RSS](/packages/classic-json-validator/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Fast, Memory Optimized, IDE-friendly JSON Validator
===================================================

[](#fast-memory-optimized-ide-friendly-json-validator)

```
composer req classic/json-validator
```

### Code

[](#code)

```
$validator = ValidationFactory::makeValidator([
    'shemaMap' => [
        CityLocatesInEuropeCustomSchema::class => new CityLocatesInEuropeCustomHandler()
    ]
]);
$sf = $validator->getSchemaFactory();

$schema = $sf->object([
    'array' => $sf->array($sf->string()->email())->min(5)->max(10),
    'city' => $sf->pipeline([
        $sf->string()->enum(['Kiev', 'London', 'New York']),
        new CityLocatesInEuropeCustomSchema()
    ]),
    'moneyStringRepresentation' => $sf->numeric()->onlyString()->notNegative(),
    'nullableValue' => $sf->object()->nullable(),
    'optionalValue' => $sf->array()->optional(),
    'integer' => $sf->int()->gte(500),
]);
$schema = $sf->object(['data' => $schema]);

try {
    $validator->validate($value, $schema);
} catch (ValidationException $exception) {
    $errors = $exception->getErrors();
}
```

### Data

[](#data)

```
{
  "data": {
    "array": [
      "elijah4freelance@gmail.com",
      "support"
    ],
    "city": "Paris",
    "moneyStringRepresentation": "6000.00",
    "nullableValue": null,
    "integer": 400
  }
}
```

### Errors

[](#errors)

```
[
    [
        'path' => 'data.array',
        'message' => 'array.min',
        'info' => [
            'min' => 2,
        ],
    ],
    [
        'path' => 'data.array.1',
        'message' => 'string.email',
    ],
    [
        'path' => 'data.city',
        'message' => 'string.enum',
        'info' => [
            'enum' => [
                'Kiev',
                'London',
                'New York',
            ],
        ],
    ],
    [
        'path' => 'data.integer',
        'message' => 'number.gte',
        'info' => [
            'value' => '500',
        ],
    ],
];
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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/8ef3f43d02f2cf9d36f07c23096a6aa8929636956896c4c74c6f74a53670b14a?d=identicon)[ilushasuccess](/maintainers/ilushasuccess)

---

Top Contributors

[![ElijahKaftanov](https://avatars.githubusercontent.com/u/13892202?v=4)](https://github.com/ElijahKaftanov "ElijahKaftanov (3 commits)")

### Embed Badge

![Health badge](/badges/classic-json-validator/health.svg)

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

PHPackages © 2026

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