jsonapi-rb / jsonapi-rails

Rails gem for fast jsonapi-compliant APIs.
http://jsonapi-rb.org
MIT License
321 stars 63 forks source link

can't add custom message on jsonapi_errors, it a bug isn't it? #119

Open helmiItsavirus opened 4 years ago

helmiItsavirus commented 4 years ago

how to add some custom message like meta on jsonapi_errors ?

this is original example { "errors": [ { "status": "422", "source": { "pointer": "/data/attributes/password" }, "title": "Unprocessable Entity", "detail": "Password is invalid", "code": "invalid" } ] }

I want add some error message like :

{ "errors": [ { "status": "422", "source": { "pointer": "/data/attributes/password" }, "title": "Unprocessable Entity", "detail": "Password is invalid", "code": "invalid" "custom_message1" : { "value1" : "1", "value2" : "2" }, "custom_message1" : { "value1" : "1", "value2" : "2" } } ] }