Open pareeohnos opened 3 months ago
@pareeohnos Just one minor note--your description says ":unprocessable_entity in favour of :unprocessible_entity" the second time around.
@pareeohnos I fixed this issue in my application by just adding the key back into the Rack utils for now:
Rack::Utils::SYMBOL_TO_STATUS_CODE[:unprocessable_entity] = 422
While I might expect the JR maintainers to fix this for current versions, I'm still running 0.9.12
and am not expecting a backport, so this is the simplest solution for me at the moment.
@pareeohnos Just one minor note--your description says ":unprocessable_entity in favour of :unprocessible_entity" the second time around.
Whoops, good catch I've fixed.
@pareeohnos I fixed this issue in my application by just adding the key back into the Rack utils for now:
Rack::Utils::SYMBOL_TO_STATUS_CODE[:unprocessable_entity] = 422
While I might expect the JR maintainers to fix this for current versions, I'm still running
0.9.12
and am not expecting a backport, so this is the simplest solution for me at the moment.
Ah yeah that's a nice simple fix. The PR I've opened should be backwards compatible so if it gets merged and you are able to upgrade it shouldn't break anything but that's definitely the way to go until it's merged
This issue is a (choose one):
Checklist before submitting:
Description
A change introduced to Rack deprecates the status
: unprocessable_entity
in favour of:unprocessable_content
. They have handled this deprecation internally, howeverjsonapi-resources
retrieves the status code by directly accessing theRack::Utils::SYMBOL_TO_STATUS_CODE
hash. Due to the deprecation, no status is found which results injsonapi-resources
returning a0
status when there are validation errors.Short term this can be fixed by using the Rack methods for status retrieval rather than accessing the hash directly. Longer term,
jsonapi-resources
will need to stop using:unprocessable_entity
in favour of: unprocessable_entity
but it would have to be done in a way that checks the version of Rack.Reproducible code: