Correct the README on param versioning and unsupported request bodies - #2961
Open
ericproulx wants to merge 1 commit into
Open
ericproulx wants to merge 1 commit into
ericproulx wants to merge 1 commit into
Conversation
Two statements in the README no longer describe what Grape does. `using: :param` was documented as reading the version "either in the URL query string or in the request body". The versioner has read the query string alone since 22b3aef (v0.10.0, 2013), which stopped building a Rack::Request there; a version in a JSON or form body is ignored and the request goes to the first version mounted. An API with `format :json` was documented as answering a body of another content type -- or of none, without `default_format` -- with 406. It has answered 415 since #1765 (2018), whose UPGRADING entry says so; the README kept the old number in both places. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
ericproulx
force-pushed
the
docs/readme-param-version-and-415
branch
from
September 18, 2026 14:59
19e4aad to
405eac3
Compare
Danger ReportNo issues found. |
dblock
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three README statements no longer describe what Grape does. I checked each against 3.3.5, 4.0.1 and master; all three behave identically.
using: :paramreads the query string only. The README says clients pass the version "either in the URL query string or in the request body". A version in a JSON or form body is ignored, and the request goes to whichever version was mounted first, withversionset tonil. The versioner has read onlyQUERY_STRINGsince 22b3aef ("Don't create Grape::Request multiple times", v0.10.0, 2013). Before that it usedrequest.params, so the sentence was once true for form bodies.An unsupported request content type answers 415, not 406. On a
format :jsonAPI:Content-Type: text/plain(or any unsupported type)Content-Type, nodefault_formatContent-Type,default_format :jsonThe switch to 415 was deliberate (#1765, 2018) and has an UPGRADING entry ("Grape will no longer return a 406 … and will instead return a 415"). The README kept the old number in both places.
Docs only; no code changes.
🤖 Generated with Claude Code