Skip to content

Correct the README on param versioning and unsupported request bodies - #2961

Open
ericproulx wants to merge 1 commit into
masterfrom
docs/readme-param-version-and-415
Open

ericproulx wants to merge 1 commit into
masterfrom
docs/readme-param-version-and-415

Conversation

@ericproulx

Copy link
Copy Markdown
Contributor

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: :param reads 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, with version set to nil. The versioner has read only QUERY_STRING since 22b3aef ("Don't create Grape::Request multiple times", v0.10.0, 2013). Before that it used request.params, so the sentence was once true for form bodies.

An unsupported request content type answers 415, not 406. On a format :json API:

request body README said Grape answers
Content-Type: text/plain (or any unsupported type) 406 415
no Content-Type, no default_format 406 415
no Content-Type, default_format :json parsed as JSON parsed as JSON

The 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

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
ericproulx force-pushed the docs/readme-param-version-and-415 branch from 19e4aad to 405eac3 Compare September 18, 2026 14:59
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@ericproulx
ericproulx requested a review from dblock September 18, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants