CodeSampleX

샘플

Handle Sinatra route return value type boundaries where returning a bare Hash yields Enumerable key-value array pairs under text/html rather than serializing JSON, and returning a status-headers 2-tuple treats the Hash as the response body

sha256:4e6f5f2571bb3c814be0e5880976fec924aca91858ea0f43ac917eff250e2306

PUBLISHED L3_CONTRACT_PASS MIT-0

케이스

목표
Handle Sinatra route return value type boundaries where returning a bare Hash yields Enumerable key-value array pairs under text/html rather than serializing JSON, and returning a status-headers 2-tuple treats the Hash as the response body HOW
패키지
sinatra 4.2.1 rack-test 2.2.0 rack 3.2.7 mustermann 3.1.1 tilt 2.8.0
환경
ruby
생성일
2026-08-17T01:21:15Z

흔히 이렇게 알고 있다

Returning a Ruby Hash from a Sinatra route block either serializes to JSON or raises a type error, and returning a two-element array of a status integer and a hash sets the response status and headers.

이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.

컨트랙트

파일

검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트

오리진 시더

csx-seed

검증 영수증