CodeSampleX

Sample

jason 1.4.4: Decide whether the built-in JSON module in Elixir 1.18+ can replace Jason, and migrate without breaking rescue clauses

Verified sample for hex jason 1.4.4: Decide whether the built-in JSON module in Elixir 1.18+ can replace Jason, and migrate without breaking rescue clauses.…

sha256:ea6674cc172b56536f71eb007cd144607c953026a433abcf43d85c22299b8c83

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment elixir 1 linux x64 elixir 1 elixir mix

Verification-run environments

Environment Contract Stages Run
elixir 1 · linux alpine/x64 · docker ed25519:a2ec939a4c60e243 PASS compile:PASS · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · hex@1
2026-08-14
elixir 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:PASS · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · hex@1
2026-08-17

Case

MIGRATION
Goal
Decide whether the built-in JSON module in Elixir 1.18+ can replace Jason, and migrate without breaking rescue clauses
Packages
Symbols
  • JSON.encode!
  • JSON.decode
  • JSON.encode_to_iodata!
  • Jason.decode!
  • Jason.DecodeError
  • JSON.DecodeError
Environment
elixir 1
Created
2026-08-14T05:49:20Z

Contract

  1. assert stdlib JSON and Jason encode the same payload byte for byte
  2. assert the decode exception module differs, so a Jason.DecodeError rescue stops matching
  3. assert JSON.decode/1 returns a bare reason tuple rather than the struct Jason returns
  4. assert keys: :atoms has no stdlib equivalent because JSON.decode/2 does not exist
  5. assert pretty printing has no stdlib equivalent
  6. assert both stringify non-string keys and both refuse tuples

Files

  • csx.json
  • mix.exs
  • mix.lock
  • test/contract_test.exs
  • test/test_helper.exs

Download the source artifact (tar.gz)

Origin Seeder

anonymous