Class: EasyTalk::ErrorFormatter::Jsonapi
- Defined in:
- lib/easy_talk/error_formatter/jsonapi.rb
Overview
Formats validation errors according to the JSON:API specification.
JSON:API defines a standard error format with specific fields for status, source, title, detail, and optional code.
Constant Summary collapse
- DEFAULT_STATUS =
Default values for JSON:API error fields
'422'- DEFAULT_TITLE =
'Invalid Attribute'
Instance Method Summary collapse
-
#format ⇒ Hash
Format the errors as a JSON:API error response.
Constructor Details
This class inherits a constructor from EasyTalk::ErrorFormatter::Base
Instance Method Details
#format ⇒ Hash
Format the errors as a JSON:API error response.
33 34 35 36 37 |
# File 'lib/easy_talk/error_formatter/jsonapi.rb', line 33 def format { 'errors' => build_errors_array } end |