Closed amkirwan closed 9 years ago
Thanks for the pull request! I need to think this through, since it sets conventions for how error resources should look in Yaks, something we don't have as of yet.
It'll probably be after the weekend before I can get back to you.
I understand in regards to setting a convention, I'm not sure what would be the best way to handle that. I'm using JSON-API in my applications so I'm not sure if the other formats explicitly define an error object like JSON-API does.
One thought was that by creating serialize_error
method the end user could override that if they wanted to change how errors were formatted.
The other issue regarding JSON-API that I was going to try and figure out was how to format self
and related
links in relationships objects. Currently I don't think Yaks formats them correctly
@amkirwan I have tried to formulate a concrete proposal for a unified model for representing errors in Yaks. Please have a look at #112 and see if you have any feedback or input.
I'm going to close this pull request, if we can reach agreement on the approach outlined in #112 I'm happy to add error handling to JSON-API.
This request adds an error serializer method to generate correctly formatted JSON-API error object. Previously there was no error serializer for JSON-API which caused errors mappers to render incorrectly. Details on the JSON-API error object format are listed in the docs .