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)1670[1 PRs](https://github.com/Phauthentic/problem-details-symfony-bundle/pulls)MITPHPPHP ^8.2CI passing

Since Jan 5Pushed 1y 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 1mo ago

READMEChangelog (7)Dependencies (10)Versions (9)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

35

—

LowBetter than 80% of packages

Maintenance44

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bef35c03b7865d9cad45c22e54eb6fe8f5fc84a4ff64d47cc0f7a1ef28dbe85?d=identicon)[floriankraemer](/maintainers/floriankraemer)

---

Top Contributors

[![floriankraemer](https://avatars.githubusercontent.com/u/4996022?v=4)](https://github.com/floriankraemer "floriankraemer (8 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

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[api-platform/validator

API Platform validator component

223.2M10](/packages/api-platform-validator)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[open-dxp/opendxp

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

7310.3k29](/packages/open-dxp-opendxp)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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