PHPackages                             phauthentic/problem-details-symfony-bundle - 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. phauthentic/problem-details-symfony-bundle

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

phauthentic/problem-details-symfony-bundle
==========================================

Symfony bundle for the Problem Details for HTTP APIs RFC

1.0.0(1y ago)1699[1 PRs](https://github.com/Phauthentic/problem-details-symfony-bundle/pulls)MITPHPPHP ^8.2

Since Jan 5Pushed 2w ago1 watchersCompare

[ Source](https://github.com/Phauthentic/problem-details-symfony-bundle)[ Packagist](https://packagist.org/packages/phauthentic/problem-details-symfony-bundle)[ RSS](/packages/phauthentic-problem-details-symfony-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (10)Versions (10)Used By (0)

Problem Details Symfony Bundle
==============================

[](#problem-details-symfony-bundle)

This bundle provides support for [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html).

- Turns `ValidationFailedException` exceptions into a `ProblemDetails` responses complying with RFC 9457.
    - The error building is fully customizable.
- Provides a `ProblemDetailsFactory` service to create `ProblemDetails` instances.

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

[](#installation)

```
composer require phauthentic/problem-details-symfony-bundle
```

Documentation
-------------

[](#documentation)

Simply inject the `ProblemDetailsFactoryInterface` into your handlers and use it to create `ProblemDetails` responses.

```
class ExampleController
{
    public function __construct(
        private ProblemDetailsFactoryInterface $problemDetailsFactory
    ) {
    }

    /**
     * @Route("/example", methods={"POST"})
     */
    public function exampleAction(Request $request): Response
    {
        return $this->problemDetailsFactory->createResponse(
            type: 'https://example.net/validation-error',
            detail: 'Your request is not valid.',
            status: 422,
            title: 'Validation Error',
        );
    }
}
```

### Service Configuration

[](#service-configuration)

To add more converters to the kernel listener, you can tag additional services with `phauthentic.problem_details.exception_converter`. They must implement the [ExceptionConverterInterface](src/ExceptionConversion/ExceptionConverterInterface.php).

```
  Phauthentic\Symfony\ProblemDetails\ExceptionConversion\ValidationFailedExceptionConverter:
    arguments:
      $validationErrorsBuilder: '@Phauthentic\Symfony\ProblemDetails\Validation\ValidationErrorsBuilder'
      $problemDetailsResponseFactory: '@Phauthentic\Symfony\ProblemDetails\FromExceptionEventFactoryInterface'
    tags: ['phauthentic.problem_details.exception_converter']
```

To completely override the list of already configured listeners override

```
  Phauthentic\Symfony\ProblemDetails\ThrowableToProblemDetailsKernelListener:
    public: true
    arguments:
      $exceptionConverters: !tagged_iterator phauthentic.problem_details.exception_converter
    tags:
      - { name: 'kernel.event_listener', event: 'kernel.exception', priority: 0 }
```

in your `services.yaml`.

Problem Details Example
-----------------------

[](#problem-details-example)

```
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
Content-Language: en

{
 "type": "https://example.net/validation-error",
 "title": "Your request is not valid.",
 "errors": [
             {
               "detail": "must be a positive integer",
               "pointer": "#/age"
             },
             {
               "detail": "must be 'green', 'red' or 'blue'",
               "pointer": "#/profile/color"
             }
          ]
}

```

Alternatives
------------

[](#alternatives)

If you favor a different style of implementation check out the following bundles:

- [phpro/api-problem-bundle](https://github.com/phpro/api-problem-bundle)

License
-------

[](#license)

This bundle is under the [MIT license](LICENSE).

Copyright Florian Krämer

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance72

Regular maintenance activity

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~7 days

Total

6

Last Release

508d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4996022?v=4)[Florian Krämer](/maintainers/floriankraemer)[@floriankraemer](https://github.com/floriankraemer)

---

Top Contributors

[![floriankraemer](https://avatars.githubusercontent.com/u/4996022?v=4)](https://github.com/floriankraemer "floriankraemer (9 commits)")

---

Tags

error-responsemit-licensephpproblem-detailsrfc-9457solid-principlessymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phauthentic-problem-details-symfony-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/phauthentic-problem-details-symfony-bundle/health.svg)](https://phpackages.com/packages/phauthentic-problem-details-symfony-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

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

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[api-platform/validator

API Platform validator component

274.6M27](/packages/api-platform-validator)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)

PHPackages © 2026

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