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

ruby-grape / grape / 36440004561
99%
master: 100%

Build:
Build:
LAST BUILD BRANCH: dblock/automate-gem-release
DEFAULT BRANCH: master
Ran 28 Sep 2026 02:58PM UTC
Jobs 13
Files 166
Run time 3min
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

28 Sep 2026 02:58PM UTC coverage: 99.041% (-0.9%) from 99.983%
36440004561

Pull #3014

github

ericproulx
Validate a blank element of an optional Array block sent with others

An optional Array param given a block passed over every empty element,
even one sent next to real ones, so `[{"sku":"A"}, {}]` passed
`requires :sku` inside the block and `[{"sku":"A"}, null]` reached the
endpoint, where `params[:variants].map { |variant| variant[:sku] }`
raised. HashElementsValidator (#2957) likewise passed over every blank
element that is not a Hash.

The pass-over exists for two things, and both are kept: an optional
scope left out of an element of an Array further up (the iterator hands
its empty value to the validators), and an Array whose elements are all
blank, which ParamsScope#should_validate? passes over as if the param
were left out. An empty element sent with others is neither, and is now
validated like any other.

AttributesIterator now yields, with each value, whether it is an element
the request sent in the scope's own Array. It works that out once per
Array: an optional scope's Array whose elements are all empty is passed
over there, the rule should_validate? applies at the root, so a nested
`[{}, {}]` still passes. Base#validate! passes over an empty value only
when it is not such an element; #validate_elements! passes over only the
placeholder of a left-out scope, and an all-empty Array (reachable
through `oneof`, which runs a variant's validators directly).
HashElementsValidator passes over an Array whose elements are all blank
and otherwise rejects a blank element that is not a Hash.

DefaultValidator does not read the new flag, so where defaults are
filled in is unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Pull Request #3014: Validate a blank element of an optional Array block sent with others

1486 of 1505 branches covered (98.74%)

Branch coverage included in aggregate %.

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

36 existing lines in 8 files now uncovered.

4300 of 4337 relevant lines covered (99.15%)

14794.3 hits per line

Coverage Regressions

Lines Coverage ∆ File
11
42.31
-57.69% lib/grape/validations/validators/contract_scope_validator.rb
8
25.0
-75.0% lib/grape/validations/contract_scope.rb
7
65.22
-34.78% lib/grape/json.rb
4
84.85
-15.15% lib/grape/dsl/entity.rb
2
94.55
-5.45% lib/grape/error_formatter/base.rb
2
63.64
-36.36% lib/grape/xml.rb
1
80.0
-20.0% lib/grape/params_builder/hashie_mash.rb
1
99.72
-0.28% lib/grape/util/inheritable_setting.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rack_2_2.gemfile - 36440004561.1 28 Sep 2026 02:59PM UTC 165
98.77
GitHub Action Run
2 run-4.0-gemfiles/rails_8_0.gemfile - 36440004561.2 28 Sep 2026 03:00PM UTC 166
98.78
GitHub Action Run
3 run-3.3-gemfiles/rails_8_0.gemfile - 36440004561.3 28 Sep 2026 02:58PM UTC 166
98.8
GitHub Action Run
4 run-3.4-gemfiles/rails_7_2.gemfile - 36440004561.4 28 Sep 2026 03:01PM UTC 166
98.78
GitHub Action Run
5 run-4.0-gemfiles/rack_3_0.gemfile - 36440004561.5 28 Sep 2026 02:59PM UTC 165
98.78
GitHub Action Run
6 run-3.3-gemfiles/rack_3_0.gemfile - 36440004561.6 28 Sep 2026 02:59PM UTC 165
98.8
GitHub Action Run
7 run-3.3-Gemfile - 36440004561.7 28 Sep 2026 02:58PM UTC 165
98.8
GitHub Action Run
8 run-3.4-gemfiles/rails_8_1.gemfile - 36440004561.8 28 Sep 2026 02:59PM UTC 166
98.78
GitHub Action Run
9 run-3.3-gemfiles/rails_8_1.gemfile - 36440004561.9 28 Sep 2026 02:58PM UTC 166
98.8
GitHub Action Run
10 run-3.3-gemfiles/rack_3_1.gemfile - 36440004561.10 28 Sep 2026 02:58PM UTC 165
98.8
GitHub Action Run
11 run-3.4-gemfiles/rack_2_2.gemfile - 36440004561.11 28 Sep 2026 02:59PM UTC 165
98.75
GitHub Action Run
12 run-4.0-Gemfile - 36440004561.12 28 Sep 2026 02:59PM UTC 165
98.78
GitHub Action Run
13 run-4.0-gemfiles/multi_json_1_20.gemfile - 36440004561.13 28 Sep 2026 02:58PM UTC 164
45.87
GitHub Action Run
Source Files on build 36440004561
  • Tree
  • List 166
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36440004561
  • Pull Request #3014
  • PR Base - master (#36439852265)
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