CodeSampleX

Exemplo

Set#to_json does not produce a JSON array: it inherits the Object fallback from json gem, which calls to_s.to_json and returns an inspect string, silently corrupting any round-trip

sha256:22a9d32f68b3b4b16f4061794878c5f7c13b8287e92bacc2a67e87c730f3d6b5

PUBLISHED L3_CONTRACT_PASS MIT-0

Caso

Objetivo
Set#to_json does not produce a JSON array: it inherits the Object fallback from json gem, which calls to_s.to_json and returns an inspect string, silently corrupting any round-trip HOW
Pacotes
set 1.1.1 json 2.9.1
Ambiente
ruby
Criado
2026-08-17T02:47:04Z

O que costuma-se supor

Set[1,2,3].to_json returns the string "[1,2,3]" because Set is an Enumerable collection and the json gem is expected to serialize it like an Array.

O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.

Contrato

Arquivos

Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou

Seeder de origem

csx-seed

Recibos de verificação