Comments (6)
For what it's worth, Rack just follows the specifications as defined by various RFCs.
Relevant RFCs
Both of the following RFCs define 422 but with a one-word difference:
- RFC 4918, "Proposed Standard", June 2007, "Unprocessable Entity"
- RFC 9110, "Internet Standard", June 2022, "Unprocessable Content"
Potential Confusion: Even though RFC 9110 it is newer, it does not obsolete RFC 4918 (directly nor transitively).
Arguments in Favor of RFC 9110
- RFC 9110 is titled "HTTP Semantics" which is a direct fit for this library, whereas RFC 4918 is scoped to WebDAV.
- RFC 9110 is an Internet Standard while RFC 4918 is only a Proposed Standard.
- MDN uses RFC 9110 for the 422 status code
- RFC 9110 is newer (2022 vs. 2007)
RFC 9110: 422: Unprocessable Content
15.5.21. 422 Unprocessable Content
The 422 (Unprocessable Content) status code indicates that the server understands the content type of the request content (hence a 415 (Unsupported Media Type) status code is inappropriate), and the syntax of the request content is correct, but it was unable to process the contained instructions. For example, this status code can be sent if an XML request content contains well-formed (i.e., syntactically correct), but semantically erroneous XML instructions.References
From hyperium/http#664.
from rspec-rails.
Nice catch. Would you like to submit a PR?
The simplest possible PR is here:
@sarvesh-sankaranarayanan, yeah, I tend to prefer encouraging people to move forward with changes like this. However, this change is more about using Rack's API in a better way. It looks like the Rack developers are going to add a deprecation warning for this change, and then force people to move over a future version.
from rspec-rails.
Nice work team!
from rspec-rails.
Nice catch. Would you like to submit a PR?
from rspec-rails.
@pirj @darrenboyd Shouldn't we actually ask developers to use the actual changed status code name as per rack-utils, instead of supporting the old name?
from rspec-rails.
This is how the public rack api behaves.
Who knows, might be they’ll decide to change the status back?
How would you interpret the definition of the “symbol to status code” as referenced from the assert_response mapping description in Rails guides?
from rspec-rails.
Related Issues (20)
- Rails 7.1 hangs in github actions when use_transactional_fixtures = true HOT 7
- "expect to receive with" throws error when switching to Rails 7.1 HOT 17
- Rails/RedundantActiveRecordAllMethod false positive HOT 1
- Rails 7.1 upgrade: using deprecated preview_path= HOT 3
- Rails 7.1 raise WrongScopeError on take_failed_screenshot HOT 3
- be_routable not working in controller spec with Rails 7.1 HOT 2
- Wrap examples with Rails executor HOT 2
- Fixtures for namespaced models don't seem to work in rspec-rails 6.1.0 HOT 6
- Even if specify the use of TestUnit, it will be overwritten by Minitest and cannot be used. HOT 6
- stub_template isn't working as expected on latest version HOT 1
- render_template is not working HOT 12
- View example group inserts controller path into lookup_context in the wrong order HOT 2
- :git => "git://github.com/rspec/rspec.git" Not working anymore HOT 3
- rspec describe/context label within loop not woking HOT 5
- Controllers specs don't currently work on the Rails main branch (8.0.0.alpha) HOT 5
- Railtie inclusion fails but only from RSpec. (undefined method '+' for class 'Date') HOT 9
- Resetting `ActiveSupport::CurrentAttributes` can be inconsistent due to hook ordering HOT 13
- Private Method Conflict Between Helpers Causes Incorrect Method Call HOT 6
- No route matches when I run controller rspec ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspec-rails.