CodeSampleX

Sample

faraday 2.14.3: Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies

Verified sample for gem faraday 2.14.3: Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error…

sha256:3689a956358214e59bb0f50e25447a90b64486b545cea81b569a8c7373cc8f45

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
1
Declared environment ruby linux x64 ruby ruby bundler

Verification-run environments

Environment Contract Stages Run
ruby 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-16
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 SKIPPED compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL
CONTAINER_RUN · rubygems@1
2026-08-18

Case

HOW
Goal
Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies
Packages
Symbols
  • Faraday::NestedParamsEncoder.decode
  • Faraday::NestedParamsEncoder.encode
  • Faraday::FlatParamsEncoder.decode
  • Faraday::TimeoutError
  • Faraday::ServerError
  • Faraday::ClientError
  • Faraday::RequestTimeoutError
  • Faraday::Error
Environment
ruby
Created
2026-08-16T17:18:49Z

Contract

  1. Faraday::NestedParamsEncoder.decode raises Ruby core TypeError instead of Faraday::ParsingError when a scalar parameter precedes a nested key, but silently overwrites and returns the scalar when the nested key comes first.
  2. TypeError raised on parameter collisions does not inherit from Faraday::Error, escaping rescue Faraday::Error handlers.
  3. Faraday::NestedParamsEncoder.decode converts nested hashes whose subkeys are all numeric digits into an Array sorted lexicographically by string comparison.
  4. Faraday::NestedParamsEncoder.encode raises Ruby core TypeError rather than Faraday::Error or ArgumentError when input cannot be converted to a Hash.
  5. Faraday::FlatParamsEncoder.decode preserves colliding keys without raising exceptions or converting nested structures.
  6. Faraday::TimeoutError inherits from Faraday::ServerError rather than Faraday::ClientError, meaning rescue Faraday::ServerError intercepts client timeouts while rescue Faraday::ClientError only catches HTTP 408 Faraday::RequestTimeoutError.
  7. Faraday::RequestTimeoutError inherits from Faraday::ClientError for HTTP 408 responses.
  8. Faraday::NilStatusError inherits from Faraday::ServerError when status cannot be derived.
  9. Faraday::ConnectionFailed inherits directly from Faraday::Error rather than ClientError or ServerError.
  10. Faraday::Error#response returns a Hash rather than a Faraday::Response instance, causing direct method calls like response.status to raise NoMethodError.

Files

  • Gemfile
  • Gemfile.lock
  • NOTES.md
  • csx.json
  • test/contract.rb

Download the source artifact (tar.gz)

Origin Seeder

csx-seed