Let `code` be usable in error objects response
Expected Behavior
That I can set the code in the error response objects
Actual Behavior
I can only set these attributes:
{"status"=>nil, "source"=>nil, "title"=>nil, "detail"=>nil}
Steps to Reproduce the Problem
- use
render jsonapi_errors: { code: "some_code" }
I think it all comes from here: https://github.com/stas/jsonapi.rb/blob/07a96dc7b8d709b1281d09168746e46115c2fd0e/lib/jsonapi/error_serializer.rb#L11
and according to the spec I should be able to do this: https://jsonapi.org/format/#error-objects
maybe it should also support meta, id and links as well when you supply something that isn't an active model to jsonapi_errors ?
@curtis741 sorry for the late response, please feel free to share a PR and we'll get it merged :pray:
@stas opened: https://github.com/stas/jsonapi.rb/pull/95
This can be closed as https://github.com/stas/jsonapi.rb/commit/7a105a5c4951e51f410533780a40b9a2efa79c28