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

ruby-grape / grape / 35332762996
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: fix/api-format-undeclared-content-type
DEFAULT BRANCH: master
Ran 18 Sep 2026 10:04AM UTC
Jobs 32
Files 168
Run time 2min
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

18 Sep 2026 10:03AM UTC coverage: 99.046% (-0.01%) from 99.06%
35332762996

Pull #2957

github

ericproulx
Reject an element that is not a Hash in an Array param given a block

The block of `requires :items, type: Array do ... end` declares the keys of
each element, but nothing checked that an element had keys at all. One
that was not a Hash only failed where the block required a key of it --
`items[0][key] is missing` -- so a block of optional params let a String, a
number or a nested Array straight through to the endpoint:

    optional :lines, type: Array do
      optional :sku, type: String
      optional :qty, type: Integer
    end
    # {"lines":["x", 5, [{"sku":"a"}]]}  => passes; lines.sum { _1[:qty] } raises

#2838 stopped the iterator unwrapping an Array nested deeper than the
declaration, and relied on those required keys to fail it. Where the
nested scope's params are optional there are none, so
`{"orders":[[{"lines":5}]]}` against an Array scope nested in another now
passed validation -- 3.3.5 had answered 400 -- and `declared` then raised
NoMethodError calling `any?` on the 5.

ParamsScope now registers a HashElementsValidator for every `type: Array`
param given a block, which answers `items[1] is invalid` for the first
element that is neither a Hash nor blank. Blank elements are still passed
over, as the block's own validators pass over an optional scope whose
elements are all blank. `Array[JSON]` already checks its elements when it
parses them.

`declared` also stops raising on a value that is neither a Hash nor an
Array where nested params are declared, and returns it as it came in, as
#2935 made it do for such an element. Validation no longer lets one reach
it through an Array, but a `given` whose dependency is not met still leaves
its params unvalidated, and `{"address":"somewhere"}` against a Hash scope
inside one raised the same NoMethodError on 3.3.5 and since.

UPGRADING covers the stricter validation and the element error that now
leads a required key's.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2957: Reject an element that is not a Hash in an Array param given a block

1434 of 1489 branches covered (96.31%)

Branch coverage included in aggregate %.

14 of 14 new or added lines in 3 files covered. (100.0%)

4276 of 4276 relevant lines covered (100.0%)

28731.46 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/multi_json_1_20.gemfile - 35332762996.1 18 Sep 2026 10:05AM UTC 166
46.03
GitHub Action Run
2 run-4.0-gemfiles/grape_swagger.gemfile - 35332762996.2 18 Sep 2026 10:05AM UTC 166
53.32
GitHub Action Run
3 run-4.0-gemfiles/multi_xml.gemfile - 35332762996.3 18 Sep 2026 10:05AM UTC 166
45.72
GitHub Action Run
4 run-3.4-gemfiles/rails_8_0.gemfile - 35332762996.4 18 Sep 2026 10:06AM UTC 168
97.87
GitHub Action Run
5 run-3.3-gemfiles/rails_7_2.gemfile - 35332762996.5 18 Sep 2026 10:05AM UTC 168
97.88
GitHub Action Run
6 run-4.0-gemfiles/rack_3_0.gemfile - 35332762996.6 18 Sep 2026 10:05AM UTC 167
97.85
GitHub Action Run
7 run-4.0-gemfiles/hashie.gemfile - 35332762996.7 18 Sep 2026 10:05AM UTC 166
59.9
GitHub Action Run
8 run-4.0-gemfiles/rack_2_2.gemfile - 35332762996.8 18 Sep 2026 10:05AM UTC 167
97.81
GitHub Action Run
9 run-4.0-gemfiles/rails_7_2.gemfile - 35332762996.9 18 Sep 2026 10:05AM UTC 168
97.85
GitHub Action Run
10 run-3.3-gemfiles/rails_8_1.gemfile - 35332762996.10 18 Sep 2026 10:05AM UTC 168
97.88
GitHub Action Run
11 run-3.4-gemfiles/rack_3_0.gemfile - 35332762996.11 18 Sep 2026 10:05AM UTC 167
97.85
GitHub Action Run
12 run-4.0-gemfiles/rack_3_2.gemfile - 35332762996.12 18 Sep 2026 10:05AM UTC 167
97.86
GitHub Action Run
13 run-3.3-gemfiles/rack_2_2.gemfile - 35332762996.13 18 Sep 2026 10:05AM UTC 167
97.85
GitHub Action Run
14 run-4.0-gemfiles/rails_8_1.gemfile - 35332762996.14 18 Sep 2026 10:05AM UTC 168
97.85
GitHub Action Run
15 run-4.0-gemfiles/rails_8_0.gemfile - 35332762996.15 18 Sep 2026 10:05AM UTC 168
97.87
GitHub Action Run
16 run-3.3-gemfiles/rails_8_0.gemfile - 35332762996.16 18 Sep 2026 10:05AM UTC 168
97.88
GitHub Action Run
17 run-3.4-gemfiles/rack_3_2.gemfile - 35332762996.17 18 Sep 2026 10:05AM UTC 167
97.85
GitHub Action Run
18 run-3.4-gemfiles/rails_8_1.gemfile - 35332762996.18 18 Sep 2026 10:05AM UTC 168
97.87
GitHub Action Run
19 run-4.0-gemfiles/multi_json.gemfile - 35332762996.19 18 Sep 2026 10:05AM UTC 166
46.0
GitHub Action Run
20 run-4.0-gemfiles/dry_validation.gemfile - 35332762996.20 18 Sep 2026 10:05AM UTC 166
56.1
GitHub Action Run
21 run-3.4-gemfiles/rails_7_2.gemfile - 35332762996.21 18 Sep 2026 10:05AM UTC 168
97.87
GitHub Action Run
22 run-3.3-gemfiles/rack_3_1.gemfile - 35332762996.22 18 Sep 2026 10:05AM UTC 167
97.88
GitHub Action Run
23 run-3.4-gemfiles/rack_2_2.gemfile - 35332762996.23 18 Sep 2026 10:05AM UTC 167
97.81
GitHub Action Run
24 run-4.0-gemfiles/grape_entity.gemfile - 35332762996.24 18 Sep 2026 10:04AM UTC 166
48.94
GitHub Action Run
25 run-3.3-gemfiles/rack_3_2.gemfile - 35332762996.25 18 Sep 2026 10:05AM UTC 167
97.86
GitHub Action Run
26 run-4.0-gemfiles/multi_xml_0_8.gemfile - 35332762996.26 18 Sep 2026 10:05AM UTC 166
45.75
GitHub Action Run
27 run-3.3-Gemfile - 35332762996.27 18 Sep 2026 10:04AM UTC 167
97.86
GitHub Action Run
28 run-3.4-Gemfile - 35332762996.28 18 Sep 2026 10:05AM UTC 167
97.86
GitHub Action Run
29 run-4.0-Gemfile - 35332762996.29 18 Sep 2026 10:04AM UTC 167
97.85
GitHub Action Run
30 run-3.3-gemfiles/rack_3_0.gemfile - 35332762996.30 18 Sep 2026 10:05AM UTC 167
97.86
GitHub Action Run
31 run-3.4-gemfiles/rack_3_1.gemfile - 35332762996.31 18 Sep 2026 10:05AM UTC 167
97.85
GitHub Action Run
32 run-4.0-gemfiles/rack_3_1.gemfile - 35332762996.32 18 Sep 2026 10:05AM UTC 167
97.86
GitHub Action Run
Source Files on build 35332762996
  • 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 #35332762996
  • Pull Request #2957
  • PR Base - master (#35330680770)
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