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

ruby-grape / grape / 30490183440
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 29 Jul 2026 08:53PM UTC
Jobs 32
Files 167
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

29 Jul 2026 08:53PM UTC coverage: 96.961% (-0.02%) from 96.976%
30490183440

Pull #2838

github

ericproulx
Reject params nested deeper than the array scope declares

`AttributesIterator#do_each` recursed into any element that was an Array.
That recursion is required when the declaration itself nests array scopes —
`map_params` adds one level of nesting per Array-typed scope on the chain, so
the params for the inner scope really are an array of arrays — but nothing
compared the incoming depth against the declared one.

A request could therefore wrap its elements in extra arrays and have them
silently unwrapped:

    params do
      requires :lines, type: Array do
        requires :book_id, type: String
        requires :qty, type: Integer
      end
    end

`{"lines":[[{"book_id":"x","qty":1}]]}` passed validation, and `params[:lines]`
/ `declared` then handed the endpoint `[[{...}]]`. Any ordinary body assuming
the declared shape (`params[:lines].sum { |l| l[:qty] }`) died with a
`TypeError`, i.e. a 500 on malformed input. `[[]]` passed the same way.

Each scope now records, at definition time, how many Array-typed scopes sit on
its chain; the iterator descends that many levels less the one `Array.wrap`
already consumes, and yields anything deeper as-is. The attribute validators
then see a non-hash and fail it exactly as they do for any other unexpected
element type, so these requests get the 400 they always should have.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2838: Reject params nested deeper than the array scope declares

1199 of 1289 branches covered (93.02%)

Branch coverage included in aggregate %.

3811 of 3878 relevant lines covered (98.27%)

26975.37 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
94.57
0.14% lib/grape/validations/params_scope.rb
1
95.74
-2.08% lib/grape/validations/attributes_iterator.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rails_7_2.gemfile - 30490183440.1 29 Jul 2026 08:53PM UTC 167
95.59
GitHub Action Run
2 run-4.0-gemfiles/grape_swagger.gemfile - 30490183440.2 29 Jul 2026 08:54PM UTC 166
55.45
GitHub Action Run
3 run-4.0-gemfiles/multi_json_1_20.gemfile - 30490183440.3 29 Jul 2026 08:54PM UTC 166
47.8
GitHub Action Run
4 run-4.0-gemfiles/rack_3_0.gemfile - 30490183440.4 29 Jul 2026 08:54PM UTC 166
95.58
GitHub Action Run
5 run-3.4-gemfiles/rack_3_0.gemfile - 30490183440.5 29 Jul 2026 08:53PM UTC 166
95.58
GitHub Action Run
6 run-3.3-gemfiles/rack_2_2.gemfile - 30490183440.6 29 Jul 2026 08:53PM UTC 166
95.54
GitHub Action Run
7 run-4.0-gemfiles/rails_7_2.gemfile - 30490183440.7 29 Jul 2026 08:54PM UTC 167
95.59
GitHub Action Run
8 run-3.3-gemfiles/rails_7_2.gemfile - 30490183440.8 29 Jul 2026 08:54PM UTC 167
95.59
GitHub Action Run
9 run-3.3-gemfiles/rails_8_1.gemfile - 30490183440.9 29 Jul 2026 08:54PM UTC 167
95.59
GitHub Action Run
10 run-4.0-gemfiles/rails_8_1.gemfile - 30490183440.10 29 Jul 2026 08:54PM UTC 167
95.59
GitHub Action Run
11 run-3.3-gemfiles/rack_3_0.gemfile - 30490183440.11 29 Jul 2026 08:53PM UTC 166
95.58
GitHub Action Run
12 run-4.0-gemfiles/dry_validation.gemfile - 30490183440.12 29 Jul 2026 08:54PM UTC 166
58.15
GitHub Action Run
13 run-3.3-gemfiles/rack_3_2.gemfile - 30490183440.13 29 Jul 2026 08:54PM UTC 166
95.58
GitHub Action Run
14 run-4.0-gemfiles/rack_2_2.gemfile - 30490183440.14 29 Jul 2026 08:54PM UTC 166
95.54
GitHub Action Run
15 run-3.4-gemfiles/rails_8_0.gemfile - 30490183440.15 29 Jul 2026 08:53PM UTC 167
95.59
GitHub Action Run
16 run-4.0-Gemfile - 30490183440.16 29 Jul 2026 08:54PM UTC 166
95.58
GitHub Action Run
17 run-4.0-gemfiles/rack_3_1.gemfile - 30490183440.17 29 Jul 2026 08:54PM UTC 166
95.58
GitHub Action Run
18 run-4.0-gemfiles/multi_xml.gemfile - 30490183440.18 29 Jul 2026 08:54PM UTC 166
47.16
GitHub Action Run
19 run-3.3-gemfiles/rails_8_0.gemfile - 30490183440.19 29 Jul 2026 08:54PM UTC 167
95.59
GitHub Action Run
20 run-3.4-gemfiles/rack_3_2.gemfile - 30490183440.20 29 Jul 2026 08:53PM UTC 166
95.58
GitHub Action Run
21 run-3.4-gemfiles/rack_3_1.gemfile - 30490183440.21 29 Jul 2026 08:53PM UTC 166
95.58
GitHub Action Run
22 run-4.0-gemfiles/rack_3_2.gemfile - 30490183440.22 29 Jul 2026 08:54PM UTC 166
95.58
GitHub Action Run
23 run-3.4-gemfiles/rails_8_1.gemfile - 30490183440.23 29 Jul 2026 08:53PM UTC 167
95.59
GitHub Action Run
24 run-3.3-Gemfile - 30490183440.24 29 Jul 2026 08:54PM UTC 166
95.58
GitHub Action Run
25 run-3.3-gemfiles/rack_3_1.gemfile - 30490183440.25 29 Jul 2026 08:53PM UTC 166
95.58
GitHub Action Run
26 run-4.0-gemfiles/multi_json.gemfile - 30490183440.26 29 Jul 2026 08:54PM UTC 166
47.76
GitHub Action Run
27 run-3.4-gemfiles/rack_2_2.gemfile - 30490183440.27 29 Jul 2026 08:53PM UTC 166
95.54
GitHub Action Run
28 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30490183440.28 29 Jul 2026 08:54PM UTC 166
47.2
GitHub Action Run
29 run-4.0-gemfiles/hashie.gemfile - 30490183440.29 29 Jul 2026 08:54PM UTC 166
62.1
GitHub Action Run
30 run-4.0-gemfiles/grape_entity.gemfile - 30490183440.30 29 Jul 2026 08:54PM UTC 166
50.46
GitHub Action Run
31 run-4.0-gemfiles/rails_8_0.gemfile - 30490183440.31 29 Jul 2026 08:54PM UTC 167
95.59
GitHub Action Run
32 run-3.4-Gemfile - 30490183440.32 29 Jul 2026 08:54PM UTC 166
95.58
GitHub Action Run
Source Files on build 30490183440
  • Tree
  • List 167
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30490183440
  • Pull Request #2838
  • PR Base - master (#30486032579)
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