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

lostisland / faraday / #4772
96%
master: 92%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 26 Nov 2026 05:16PM UTC
Jobs 1
Files 35
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

26 Nov 2026 05:16PM UTC coverage: 96.594% (+0.01%) from 96.581%
#4772

push

web-flow
Decode hashes and arrays nested inside an array (#1742)

* Decode hashes and arrays nested inside an array

NestedParamsEncoder.decode raised TypeError on four query shapes that
NestedParamsEncoder.encode itself produces, among them a[][b][c]=d,
which is what { 'a' => [{ 'b' => { 'c' => 'd' } }] } encodes to.

prepare_context built the nested container before working out which
element of the array it belonged to, so new_context indexed an Array
with a String key. Resolve the array element first, and let a repeated
key that is itself an array extend that element instead of starting a
new one, which is what Rack::Utils.parse_nested_query does.

All four shapes now decode to exactly Rack's result. No other decode
result changes.

Assisted-by: Claude Code <noreply@anthropic.com>

* test: compare nested param decoding with Rack over a list of queries

Bugs in NestedParamsEncoder.decode show up as query shapes that Rack
decodes and Faraday does not. The author and the reviewer of #1742
each built a list of queries to compare the two, and neither list was
kept.

The spec keeps one list of 26 queries, each testing a different rule.
Faraday must decode 19 of them exactly as Rack does, or raise the same
error. 4 run as pending, because Faraday still starts a new array
element in cases where Rack does not. RSpec fails each pending example
once it matches Rack, so the list stays current. The last 3 are
differences that Faraday keeps on purpose, and the spec pins them.

This depends on the fix in #1742: on main, 16 of the examples fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: merge keys under the same array element as Rack does

The first fix stopped decode from raising on hashes nested in an
array. But to decide whether a key starts a new array element, it
looked only at the first key below the array. So
a[][b][c]=d&a[][b][e]=f decoded to two elements instead of one. A
round-trip through encode and decode also returned a different
structu... (continued)

10 of 10 new or added lines in 1 file covered. (100.0%)

1730 of 1791 relevant lines covered (96.59%)

156.3 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #4772.1 26 Nov 2026 05:16PM UTC 35
96.59
Source Files on build #4772
  • Tree
  • List 35
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b4d81f32 on github
  • Prev Build on main
  • Next Build on main
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