Skip to content

Render error when unable to deserialize resource#4

Merged
JoeWoodward merged 1 commit into
masterfrom
chore/render_error_when_nil_deserialized
Sep 17, 2018
Merged

Render error when unable to deserialize resource#4
JoeWoodward merged 1 commit into
masterfrom
chore/render_error_when_nil_deserialized

Conversation

@JoeWoodward
Copy link
Copy Markdown

Adds config option to set what happens when unable to deserialize payload

  # config.jsonapi_payload_malformed = -> {
  #   render jsonapi_errors: {
  #     title: 'Non-compliant Request Body',
  #     detail: 'The request was not formatted in compliance with the application/vnd.api+json spec',
  #     links: {
  #       about: 'http://jsonapi.org/format/'
  #     }
  #   }, status: :bad_request
  # }

Able to override on controller by controller basis
Tested!

@JoeWoodward JoeWoodward merged commit 1923af6 into master Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant