• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 35456788678
100%

Build:
DEFAULT BRANCH: master
Ran 19 Sep 2026 05:01PM UTC
Jobs 32
Files 168
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Sep 2026 05:01PM UTC coverage: 99.017% (+0.001%) from 99.016%
35456788678

push

github

web-flow
Send a content type for an api_format the API does not declare (#2959)

`api_format` picks the format a response is rendered in, and the media type
it is labelled with comes from the formats the API declares. A format the
API does not declare has none there, so on a `format :json` API

    get('/plain') { api_format :txt; 'plain' }

rendered `plain` under `content-type: nil`. Rack forbids a nil header value
and Rack::Lint raises on it; a server writes an empty header, or none. The
same goes for `:xml` and `:binary`. The only spec for `api_format :txt`
declares `content_type :txt, 'text/plain'` on its API, so the suite's
`Grape.config.lint` never met the nil.

An error raised after it went wrong the other way: the error middleware
falls back to text/html, and HTML-escapes a body it labels so, so
`error!('a < b', 400)` answered `a &lt; b` as text/html while rendering it
with the txt error formatter.

PrecomputedContentTypes, which both middlewares share, now answers
#media_type_for: the media type the API declares for a format, or else the
one Grape registers for it by default -- text/plain, application/xml,
application/octet-stream. The formatter labels a response with it and
leaves the header out for a format with no media type anywhere, a custom
formatter's; the error middleware labels an error with it before falling
back to text/html. #content_type_for is left as it is: negotiation, format
extensions and the 415 check ask it whether the API supports a format at
all, and a fallback there would accept formats the API never declared.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

1444 of 1501 branches covered (96.2%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 2 files covered. (100.0%)

4296 of 4296 relevant lines covered (100.0%)

28649.35 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rack_2_2.gemfile - 35456788678.1 19 Sep 2026 05:02PM UTC 167
97.82
GitHub Action Run
2 run-4.0-gemfiles/rails_8_1.gemfile - 35456788678.2 19 Sep 2026 05:02PM UTC 168
97.83
GitHub Action Run
3 run-4.0-gemfiles/dry_validation.gemfile - 35456788678.3 19 Sep 2026 05:02PM UTC 166
55.85
GitHub Action Run
4 run-3.4-gemfiles/rails_8_1.gemfile - 35456788678.4 19 Sep 2026 05:02PM UTC 168
97.83
GitHub Action Run
5 run-3.3-gemfiles/rack_3_2.gemfile - 35456788678.5 19 Sep 2026 05:02PM UTC 167
97.86
GitHub Action Run
6 run-3.3-Gemfile - 35456788678.6 19 Sep 2026 05:02PM UTC 167
97.86
GitHub Action Run
7 run-3.4-gemfiles/rack_3_1.gemfile - 35456788678.7 19 Sep 2026 05:02PM UTC 167
97.84
GitHub Action Run
8 run-4.0-gemfiles/multi_json_1_20.gemfile - 35456788678.8 19 Sep 2026 05:01PM UTC 166
45.95
GitHub Action Run
9 run-3.4-Gemfile - 35456788678.9 19 Sep 2026 05:02PM UTC 167
97.82
GitHub Action Run
10 run-3.3-gemfiles/rack_3_1.gemfile - 35456788678.10 19 Sep 2026 05:02PM UTC 167
97.84
GitHub Action Run
11 run-4.0-gemfiles/rails_8_0.gemfile - 35456788678.11 19 Sep 2026 05:02PM UTC 168
97.83
GitHub Action Run
12 run-4.0-gemfiles/multi_json.gemfile - 35456788678.12 19 Sep 2026 05:02PM UTC 166
45.92
GitHub Action Run
13 run-3.4-gemfiles/rails_7_2.gemfile - 35456788678.13 19 Sep 2026 05:02PM UTC 168
97.84
GitHub Action Run
14 run-4.0-gemfiles/hashie.gemfile - 35456788678.14 19 Sep 2026 05:01PM UTC 166
59.77
GitHub Action Run
15 run-3.4-gemfiles/rack_2_2.gemfile - 35456788678.15 19 Sep 2026 05:02PM UTC 167
97.81
GitHub Action Run
16 run-4.0-gemfiles/multi_xml.gemfile - 35456788678.16 19 Sep 2026 05:01PM UTC 166
45.64
GitHub Action Run
17 run-4.0-gemfiles/rack_3_1.gemfile - 35456788678.17 19 Sep 2026 05:02PM UTC 167
97.84
GitHub Action Run
18 run-3.3-gemfiles/rails_8_0.gemfile - 35456788678.18 19 Sep 2026 05:02PM UTC 168
97.84
GitHub Action Run
19 run-4.0-gemfiles/multi_xml_0_8.gemfile - 35456788678.19 19 Sep 2026 05:01PM UTC 166
45.67
GitHub Action Run
20 run-3.4-gemfiles/rails_8_0.gemfile - 35456788678.20 19 Sep 2026 05:02PM UTC 168
97.84
GitHub Action Run
21 run-3.4-gemfiles/rack_3_0.gemfile - 35456788678.21 19 Sep 2026 05:02PM UTC 167
97.84
GitHub Action Run
22 run-4.0-gemfiles/grape_entity.gemfile - 35456788678.22 19 Sep 2026 05:01PM UTC 166
48.9
GitHub Action Run
23 run-4.0-gemfiles/rack_3_2.gemfile - 35456788678.23 19 Sep 2026 05:02PM UTC 167
97.82
GitHub Action Run
24 run-3.3-gemfiles/rack_3_0.gemfile - 35456788678.24 19 Sep 2026 05:02PM UTC 167
97.86
GitHub Action Run
25 run-3.3-gemfiles/rails_7_2.gemfile - 35456788678.25 19 Sep 2026 05:02PM UTC 168
97.86
GitHub Action Run
26 run-4.0-Gemfile - 35456788678.26 19 Sep 2026 05:02PM UTC 167
97.82
GitHub Action Run
27 run-4.0-gemfiles/rack_3_0.gemfile - 35456788678.27 19 Sep 2026 05:02PM UTC 167
97.84
GitHub Action Run
28 run-4.0-gemfiles/rails_7_2.gemfile - 35456788678.28 19 Sep 2026 05:02PM UTC 168
97.83
GitHub Action Run
29 run-4.0-gemfiles/rack_2_2.gemfile - 35456788678.29 19 Sep 2026 05:02PM UTC 167
97.81
GitHub Action Run
30 run-3.3-gemfiles/rails_8_1.gemfile - 35456788678.30 19 Sep 2026 05:02PM UTC 168
97.84
GitHub Action Run
31 run-4.0-gemfiles/grape_swagger.gemfile - 35456788678.31 19 Sep 2026 05:02PM UTC 166
53.2
GitHub Action Run
32 run-3.4-gemfiles/rack_3_2.gemfile - 35456788678.32 19 Sep 2026 05:02PM UTC 167
97.82
GitHub Action Run
Source Files on build 35456788678
  • Tree
  • List 168
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #35456788678
  • 23f0d40e on github
  • Prev Build on master (#35456547515)
  • Next Build on master (#35456977305)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc