Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Output JSON-API Error Object #110

Closed
wants to merge 6 commits into from
Closed

Conversation

amkirwan
Copy link
Contributor

@amkirwan amkirwan commented Sep 1, 2015

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 .

@plexus
Copy link
Owner

plexus commented Sep 3, 2015

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.

@amkirwan
Copy link
Contributor Author

amkirwan commented Sep 4, 2015

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

@plexus
Copy link
Owner

plexus commented Sep 25, 2015

@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.

@plexus plexus closed this Sep 25, 2015
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 560d309 on amkirwan:error_json_api into ** on plexus:master**.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants