PHPackages                             outcomer/symfony-json-schema-validation - 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. [API Development](/categories/api)
4. /
5. outcomer/symfony-json-schema-validation

ActiveSymfony-bundle[API Development](/categories/api)

outcomer/symfony-json-schema-validation
=======================================

JSON Schema validation bundle for Symfony with OPIS integration

v3.0.0(4mo ago)1538MITPHPPHP &gt;=8.2CI failing

Since Jan 16Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/outcomer/symfony-json-schema-validation)[ Packagist](https://packagist.org/packages/outcomer/symfony-json-schema-validation)[ RSS](/packages/outcomer-symfony-json-schema-validation/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (12)Versions (4)Used By (0)

Stop writing DTOs, validation and OpenAPI three times in Symfony
================================================================

[](#stop-writing-dtos-validation-and-openapi-three-times-in-symfony)

[![GitHub Actions](https://github.com/outcomer/symfony-json-schema-validation/workflows/CI/badge.svg)](https://github.com/outcomer/symfony-json-schema-validation/actions)[![Latest Stable Version](https://camo.githubusercontent.com/c011789cce9fdafcf667db10381ba501dd9e3f9e2be0a754080a772932f71134/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f7574636f6d65722f73796d666f6e792d6a736f6e2d736368656d612d76616c69646174696f6e3f6c6162656c3d737461626c65)](https://packagist.org/packages/outcomer/symfony-json-schema-validation)[![PHP Version](https://camo.githubusercontent.com/c764f17b1acb3bf5cd90d636ab149f5bfde997b3dc5dd80cc82c997a55c10160/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e322d626c75652e737667)](https://php.net/)[![Symfony Version](https://camo.githubusercontent.com/2e7d18a743056f3b78b60c124b3bba97d2a01c0655a2e0abfe9e9b86da22edad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d372e342b253230253743253230382e302b2d677265656e2e737667)](https://symfony.com/)[![License](https://camo.githubusercontent.com/18e3326d755a1da8f802ea2500efe50b806a2d93fea17221517ea89a66112293/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f7574636f6d65722f73796d666f6e792d6a736f6e2d736368656d612d76616c69646174696f6e)](https://packagist.org/packages/outcomer/symfony-json-schema-validation)

Before
------

[](#before)

Typical Symfony API endpoint:

- Request DTO
- Symfony Validator constraints
- OpenAPI annotations
- Mapping logic

Same field described multiple times.

```
class CreateUserRequest
{
    #[Assert\NotBlank]
    #[Assert\Email]
    public string $email;
}
```

Plus OpenAPI annotations and mapping.

This logic is repeated in 3 different places in real projects.

---

After
-----

[](#after)

One schema:

```
{
  "type": "object",
  "required": ["email"],
  "properties": {
    "email": {
      "type": "string",
      "format": "email"
    }
  }
}
```

Used for:

- validation
- request mapping
- OpenAPI generation

One schema replaces all of this duplication.

---

⚡ Quick Start
-------------

[](#-quick-start)

### Installation

[](#installation)

```
composer require outcomer/symfony-json-schema-validation
```

### Basic Usage

[](#basic-usage)

```
use Outcomer\Bundle\SymfonyJsonSchemaValidation\Attribute\MapRequest;

class UserController
{
    #[Route('/api/users', methods: ['POST'])]
    public function create(
        #[MapRequest('schemas/user-create.json')]
        UserCreateDto $user
    ): JsonResponse {
        // $user contains validated data from request body, query, path, and headers
        return new JsonResponse(['id' => $userService->create($user)]);
    }
}
```

### JSON Schema Example

[](#json-schema-example)

```
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "body": {
      "type": "object",
      "properties": {
        "name": {"type": "string", "minLength": 1},
        "email": {"type": "string", "format": "email"}
      },
      "required": ["name", "email"]
    },
    "query": {
      "type": "object",
      "properties": {
        "locale": {"type": "string", "enum": ["en", "de", "fr"]}
      }
    },
    "headers": {
      "type": "object",
      "properties": {
        "x-api-version": {"type": "string", "pattern": "^v[1-9]$"}
      }
    }
  }
}
```

---

📚 Why
-----

[](#-why)

Read the story behind this bundle on [Hashnode](https://outcomer.hashnode.dev/symfony-bundle-that-validates-anything-and-everything)

📖 Documentation
---------------

[](#-documentation)

**[Complete Documentation](https://outcomer.github.io/symfony-json-schema-validation/)** - Visit our comprehensive documentation website

### Quick Links

[](#quick-links)

- [🔗 How It Works](https://outcomer.github.io/symfony-json-schema-validation/guide/how-it-works)
- [🔗 Installation Guide](https://outcomer.github.io/symfony-json-schema-validation/guide/installation)
- [🔗 Quick Start Tutorial](https://outcomer.github.io/symfony-json-schema-validation/guide/quick-start)
- [🔗 Schema Basics](https://outcomer.github.io/symfony-json-schema-validation/guide/schema-basics)
- [🔗 Configuration Options](https://outcomer.github.io/symfony-json-schema-validation/guide/configuration)
- [🔗 DTO Injection](https://outcomer.github.io/symfony-json-schema-validation/guide/dto-injection)
- [🔗 OpenAPI Integration](https://outcomer.github.io/symfony-json-schema-validation/guide/openapi-integration)
- [🔗 Examples](https://outcomer.github.io/symfony-json-schema-validation/guide/examples)
- [🔗 API Reference](https://outcomer.github.io/symfony-json-schema-validation/guide/api)

🚀 Features
----------

[](#-features)

- Single source of truth for API validation
- No serializer groups
- Automatic OpenAPI generation

When NOT to use this
--------------------

[](#when-not-to-use-this)

Use API Platform if you need:

- full CRUD automation
- admin panels
- heavy framework magic

Incremental adoption
--------------------

[](#incremental-adoption)

You can use this bundle:

- on a single endpoint
- together with Symfony Validator
- together with API Platform
- without rewriting your application

No migration is required.

FAQ
---

[](#faq)

### Does this replace Symfony Validator?

[](#does-this-replace-symfony-validator)

No. You can use both together.

### Does this work with API Platform?

[](#does-this-work-with-api-platform)

Yes. The bundle can coexist with API Platform.

### Is this all-or-nothing?

[](#is-this-all-or-nothing)

No. You can adopt it endpoint-by-endpoint.

### Why use JSON Schema?

[](#why-use-json-schema)

To avoid duplication between validation, request mapping and OpenAPI.

### Is there vendor lock-in?

[](#is-there-vendor-lock-in)

No. Your schemas remain standard JSON Schema documents.

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

📄 License
---------

[](#-license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

**Need Help?**

- 📖 Check our [documentation](https://outcomer.github.io/symfony-json-schema-validation/)
- 🐛 [Report issues](https://github.com/outcomer/symfony-json-schema-validation/issues)
- 💬 [Join discussions](https://github.com/outcomer/symfony-json-schema-validation/discussions)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance86

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~22 days

Total

3

Last Release

124d ago

Major Versions

v1.0.0 → v2.0.02026-01-28

v2.0.0 → v3.0.02026-03-02

PHP version history (2 changes)v1.0.0PHP &gt;=8.2

v2.0.0PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40342952?v=4)[David Evdoshchenko](/maintainers/outcomer)[@outcomer](https://github.com/outcomer)

---

Top Contributors

[![outcomer](https://avatars.githubusercontent.com/u/40342952?v=4)](https://github.com/outcomer "outcomer (32 commits)")

---

Tags

api-validationjson-schemaopenapiopisphp8request-validationsymfonysymfony-bundlesymfony8validationapisymfonybundlevalidationjson-schemaopenapiopisrequest validation

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/outcomer-symfony-json-schema-validation/health.svg)

```
[![Health](https://phpackages.com/badges/outcomer-symfony-json-schema-validation/health.svg)](https://phpackages.com/packages/outcomer-symfony-json-schema-validation)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M387](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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