Coder Social home page Coder Social logo

Comments (6)

ioquatix avatar ioquatix commented on July 30, 2024 2

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

  1. RFC 9110 is titled "HTTP Semantics" which is a direct fit for this library, whereas RFC 4918 is scoped to WebDAV.
  2. RFC 9110 is an Internet Standard while RFC 4918 is only a Proposed Standard.
  3. MDN uses RFC 9110 for the 422 status code
  4. 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.

darrenboyd avatar darrenboyd commented on July 30, 2024 2

Nice catch. Would you like to submit a PR?

The simplest possible PR is here:

#2765

@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.

ioquatix avatar ioquatix commented on July 30, 2024 1

Nice work team!

from rspec-rails.

pirj avatar pirj commented on July 30, 2024

Nice catch. Would you like to submit a PR?

from rspec-rails.

sarvesh-sankaranarayanan avatar sarvesh-sankaranarayanan commented on July 30, 2024

@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.

pirj avatar pirj commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.