{"id":23770007,"url":"https://github.com/phauthentic/problem-details-symfony-bundle","last_synced_at":"2026-02-15T15:05:17.295Z","repository":{"id":269756655,"uuid":"778503743","full_name":"Phauthentic/problem-details-symfony-bundle","owner":"Phauthentic","description":"RFC 9457 Problem Details Response Symfony Bundle","archived":false,"fork":false,"pushed_at":"2025-03-19T09:46:22.000Z","size":95,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-05T22:13:08.689Z","etag":null,"topics":["error-response","mit-license","php","problem-details","rfc-9457","solid-principles","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Phauthentic.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-27T20:53:38.000Z","updated_at":"2025-02-11T21:32:32.000Z","dependencies_parsed_at":"2024-12-25T23:19:40.246Z","dependency_job_id":"d3f76d1d-dea7-40dd-b023-dbfbf434ee66","html_url":"https://github.com/Phauthentic/problem-details-symfony-bundle","commit_stats":null,"previous_names":["phauthentic/problem-details-symfony-bundle"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Phauthentic/problem-details-symfony-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fproblem-details-symfony-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fproblem-details-symfony-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fproblem-details-symfony-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fproblem-details-symfony-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Phauthentic","download_url":"https://codeload.github.com/Phauthentic/problem-details-symfony-bundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fproblem-details-symfony-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29481925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-response","mit-license","php","problem-details","rfc-9457","solid-principles","symfony","symfony-bundle"],"created_at":"2025-01-01T02:35:27.244Z","updated_at":"2026-02-15T15:05:17.264Z","avatar_url":"https://github.com/Phauthentic.png","language":"PHP","readme":"# Problem Details Symfony Bundle\n\nThis bundle provides support for [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html).\n\n* Turns `ValidationFailedException` exceptions into a `ProblemDetails` responses complying with RFC 9457.\n  * The error building is fully customizable.\n* Provides a `ProblemDetailsFactory` service to create `ProblemDetails` instances.\n\n## Installation\n\n```bash\ncomposer require phauthentic/problem-details-symfony-bundle\n```\n\n## Documentation\n\nSimply inject the `ProblemDetailsFactoryInterface` into your handlers and use it to create `ProblemDetails` responses.\n\n```php\nclass ExampleController\n{\n    public function __construct(\n        private ProblemDetailsFactoryInterface $problemDetailsFactory\n    ) {\n    }\n\n    /**\n     * @Route(\"/example\", methods={\"POST\"})\n     */\n    public function exampleAction(Request $request): Response\n    {\n        return $this-\u003eproblemDetailsFactory-\u003ecreateResponse(\n            type: 'https://example.net/validation-error',\n            detail: 'Your request is not valid.',\n            status: 422,\n            title: 'Validation Error',\n        );\n    }\n}\n```\n\n### Service Configuration\n\nTo 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).\n\n```yaml\n  Phauthentic\\Symfony\\ProblemDetails\\ExceptionConversion\\ValidationFailedExceptionConverter:\n    arguments:\n      $validationErrorsBuilder: '@Phauthentic\\Symfony\\ProblemDetails\\Validation\\ValidationErrorsBuilder'\n      $problemDetailsResponseFactory: '@Phauthentic\\Symfony\\ProblemDetails\\FromExceptionEventFactoryInterface'\n    tags: ['phauthentic.problem_details.exception_converter']\n```\n\nTo completely override the list of already configured listeners override\n\n```yaml\n  Phauthentic\\Symfony\\ProblemDetails\\ThrowableToProblemDetailsKernelListener:\n    public: true\n    arguments:\n      $exceptionConverters: !tagged_iterator phauthentic.problem_details.exception_converter\n    tags:\n      - { name: 'kernel.event_listener', event: 'kernel.exception', priority: 0 }\n```\n\nin your `services.yaml`.\n\n## Problem Details Example\n\n```text\nHTTP/1.1 422 Unprocessable Content\nContent-Type: application/problem+json\nContent-Language: en\n\n{\n \"type\": \"https://example.net/validation-error\",\n \"title\": \"Your request is not valid.\",\n \"errors\": [\n             {\n               \"detail\": \"must be a positive integer\",\n               \"pointer\": \"#/age\"\n             },\n             {\n               \"detail\": \"must be 'green', 'red' or 'blue'\",\n               \"pointer\": \"#/profile/color\"\n             }\n          ]\n}\n```\n\n## Alternatives\n\nIf you favor a different style of implementation check out the following bundles:\n\n* [phpro/api-problem-bundle](https://github.com/phpro/api-problem-bundle)\n\n## License\n\nThis bundle is under the [MIT license](LICENSE).\n\nCopyright Florian Krämer\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphauthentic%2Fproblem-details-symfony-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphauthentic%2Fproblem-details-symfony-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphauthentic%2Fproblem-details-symfony-bundle/lists"}