CodeSampleX

Ejemplo

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

Caso

Objetivo
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
Paquetes
sinatra 4.2.1 rack-test 2.2.0 rack 3.2.7 mustermann 3.1.1 tilt 2.8.0
Entorno
ruby
Creado
2026-08-17T01:21:15Z

Lo que suele suponerse

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.

El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.

Contrato

Archivos

Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato

Seeder de origen

csx-seed

Recibos de verificación