Exemple
Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies
sha256:3689a956358214e59bb0f50e25447a90b64486b545cea81b569a8c7373cc8f45
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies HOW
- Paquets
- faraday 2.14.3
- Environnement
- ruby
- Créé
- 2026-08-16T17:18:49Z
Ce que l'on suppose souvent
Faraday::NestedParamsEncoder.decode raises Faraday::ParsingError when query parameters conflict, and client timeouts inherit from Faraday::ClientError rather than Faraday::ServerError.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- 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.
Fichiers
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9