faecie / json-api-error-response

This Bundle provides en error response as it described in JsonApi (https://jsonapi.org/format/#errors) specification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JsonApiErrorResponseBundle

Scrutinizer Code Quality Code Coverage Build Status License

This bundle provides a way return JSON:API compatible error responses from REST endponts

Perfectly works along with FOS REST bundle configured to json response. OIn this case you will alway get response in a JSONAPI compatible format. https://jsonapi.org/format/#errors

Installation

$ composer require faecie/json-api-error-response ^0.1

Configuration

You can configure the response of your exception in different ways:

  1. Implement interface DescriptiveExceptionInterface on your exception with only one method returning the array of Error objects
  2. Configure each exception class in the bandle configuration
  3. Tag you service as json_api.exception_describer and implement ExceptionDescriberInterface on it with only one method allowing you to control how to serialize your exceptions

About

This Bundle provides en error response as it described in JsonApi (https://jsonapi.org/format/#errors) specification

License:MIT License


Languages

Language:PHP 100.0%