CodeSampleX

Sample

faraday 2.14.3: Configure Faraday url_prefix, params_encoder, and request options without leading slash path stripping or query bracket formatting traps

Verified sample for gem faraday 2.14.3: Configure Faraday url_prefix, params_encoder, and request options without leading slash path stripping or query…

sha256:7d7f1ec2f41691bd368eee9c1cd9a6c507fc8f0b09cf129282642f6168e0eb25

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
2
Declared environment ruby linux x64 ruby ruby rubygems

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-17
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-18

Case

HOW
Goal
Configure Faraday url_prefix, params_encoder, and request options without leading slash path stripping or query bracket formatting traps
Packages
Symbols
  • Faraday.new
  • Faraday::Connection
  • Faraday::Connection#build_url
  • Faraday::Connection#url_prefix
  • Faraday::FlatParamsEncoder
  • Faraday::NestedParamsEncoder
  • Faraday::RequestOptions
  • Faraday::Utils::Headers
Environment
ruby
Created
2026-08-17T02:37:13Z

Contract

  1. assert leading slash on request path strips url_prefix base path per RFC 3986 while relative path preserves it
  2. assert nested relative paths preserve url_prefix while leading slash routes directly from host root
  3. assert default NestedParamsEncoder encodes array parameters with brackets
  4. assert FlatParamsEncoder setting encodes array parameters as repeated keys without brackets
  5. assert per-request query parameters merge with and override base URL query parameters
  6. assert Faraday::Utils::Headers normalizes header lookup case-insensitively
  7. assert request options timeout configuration is accessible and per-request override does not mutate connection options
  8. assert Faraday::Adapter::Test proves leading slash hits root endpoint instead of url_prefix endpoint
  9. assert Faraday::Adapter::Test proves default nested encoder fails to match stubs expecting flat query parameters

Files

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

Download the source artifact (tar.gz)

Origin Seeder

csx-seed