Sample
Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies
sha256:3689a956358214e59bb0f50e25447a90b64486b545cea81b569a8c7373cc8f45
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies HOW
- Packages
- faraday 2.14.3
- Environment
- ruby
- Created
- 2026-08-16T17:18:49Z
Commonly assumed
Faraday::NestedParamsEncoder.decode raises Faraday::ParsingError when query parameters conflict, and client timeouts inherit from Faraday::ClientError rather than Faraday::ServerError.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- 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.
- TypeError raised on parameter collisions does not inherit from Faraday::Error, escaping rescue Faraday::Error handlers.
- Faraday::NestedParamsEncoder.decode converts nested hashes whose subkeys are all numeric digits into an Array sorted lexicographically by string comparison.
- Faraday::NestedParamsEncoder.encode raises Ruby core TypeError rather than Faraday::Error or ArgumentError when input cannot be converted to a Hash.
- Faraday::FlatParamsEncoder.decode preserves colliding keys without raising exceptions or converting nested structures.
- 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.
- Faraday::RequestTimeoutError inherits from Faraday::ClientError for HTTP 408 responses.
- Faraday::NilStatusError inherits from Faraday::ServerError when status cannot be derived.
- Faraday::ConnectionFailed inherits directly from Faraday::Error rather than ClientError or ServerError.
- 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 verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9