Support for Errors
Closed this issue · 3 comments
Would be great if support for serializing errors (http://jsonapi.org/format/#error-objects) was available.
Unless they are already implemented and I'm overlooking them.
Hi, no they are not currently supported. I have looked into it in the past and it is on the TODO list. I might revisit this soon.
This is a workaround I ended up writing. Leaving it here in case it could help anybody else until this support gets officially added. Basically all it does is attempt to serialize instances of HttpError prior to running the serialization from this framework.
You just need to use JsonApiMediaTypeFormatterWithErrorSupport instead of the JsonApiMediaTypeFormatter.
FYI,
I've just pushed a release that now has support for errors. Would be good to get your feedback.
Thanks,
Cain