Sample
Serialize a T::Enum value through JSON.dump
sha256:5eb4c1715330250e8fa6c1f557809aa783f83d87070a1227be664fcb1a9a1c79
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Serialize a T::Enum value through JSON.dump HOW
- Packages
- sorbet-runtime 0.6.13427 json 2.9.1
- Environment
- ruby
- Created
- 2026-08-17T02:48:06Z
Commonly assumed
JSON.dump on a T::Enum instance raises NoMethodError instead of serializing it
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- JSON.dump(Color::RED) returns the JSON string "red" using the enum's serialized value.
Files
- Gemfile
- Gemfile.lock
- csx.json
- test/contract.rb
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9