{"id":18908955,"url":"https://github.com/diegograssato/sf-api-problem","last_synced_at":"2026-03-06T20:30:27.321Z","repository":{"id":56968431,"uuid":"62517756","full_name":"diegograssato/sf-api-problem","owner":"diegograssato","description":"Symfony API Problem","archived":false,"fork":false,"pushed_at":"2016-07-04T02:21:50.000Z","size":3,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T12:27:34.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diegograssato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-03T22:34:56.000Z","updated_at":"2016-07-03T22:38:43.000Z","dependencies_parsed_at":"2022-08-21T10:20:57.984Z","dependency_job_id":null,"html_url":"https://github.com/diegograssato/sf-api-problem","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegograssato%2Fsf-api-problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegograssato%2Fsf-api-problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegograssato%2Fsf-api-problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegograssato%2Fsf-api-problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diegograssato","download_url":"https://codeload.github.com/diegograssato/sf-api-problem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239896403,"owners_count":19715017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T09:29:49.139Z","updated_at":"2025-02-20T18:44:30.100Z","avatar_url":"https://github.com/diegograssato.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Symfony API Problem\n===================\n\n## Introduction\n\nThis library supplies a Symfony 3 compatible Response class, that accepts an ApiProblem object and returns a JSON object compilant with the [Problem Details for HTTP APIs](http://tools.ietf.org/html/draft-nottingham-http-problem-06) specification.\n\nIt is based on, and uses the ApiProblem class from, the [ZF Campus `zf-api-problem`](https://github.com/zfcampus/zf-api-problem) library for Zend Framework 2.\n\n## Installation\n\nRun the following command to install using `composer`:\n\n```bash\n$ composer require \"diegograssato/sf-api-problem:~1.0\"\n```\n\nOr add the following line to your `composer.json`:\n\n```javascript\n\"require\": {\n    \"diegograssato/sf-api-problem\": \"~1.0\"\n}\n```\n\n## Usage\n\n```php\nuse DTUX\\ApiProblem\\ApiProblem;\nuse DTUX\\ApiProblem\\ApiProblemResponse;\n\nclass FakeController\n{\n\n    public function fetch($id)\n    {\n        $entity = $this-\u003eservice-\u003efetch($id);\n\n        if (!$entity) {\n            return new ApiProblemResponse(new ApiProblem(404, 'Entity not found'));\n        }\n\n        return $entity;\n    }\n}\n```\n\nConfigure listener\n\n```yaml\n\nservices:\n    you_bundle.kernel.listener.api_exception:\n        class: DTUX\\ApiProblem\\EventListener\\ApiExceptionListener\n        arguments:\n          - '@logger'\n        tags:\n          - { name: kernel.event_listener, event: kernel.exception, method: onKernelException }\n```\n\n## License\n\nThis project is released under the BSD 3-Clause license, and is based on parts of the [ZF Campus `zf-api-problem`](https://github.com/zfcampus/zf-api-problem) library for Zend Framework 2.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegograssato%2Fsf-api-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegograssato%2Fsf-api-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegograssato%2Fsf-api-problem/lists"}