CodeSampleX

Sample

Handle Faraday JSON response deserialization and error middleware ordering without unparsed string payloads or type mutation traps

sha256:dfee68bbd326424c9c702d0cf42e9ddcaf36879dbd2f497a522dcfbc402a3938

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Handle Faraday JSON response deserialization and error middleware ordering without unparsed string payloads or type mutation traps HOW
Packages
faraday 2.14.3
Environment
ruby
Created
2026-08-17T02:38:41Z

Commonly assumed

Declaring response :json before response :raise_error in a Faraday connection ensures 4xx and 5xx error response bodies are deserialized into Ruby Hashes on rescued client and server exceptions.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts