CodeSampleX

Beispiel

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

Verifiziertes Beispiel für hex jason 1.4.4: Decide whether the built-in JSON module in Elixir 1.18+ can replace Jason, and migrate without breaking rescue…

sha256:ea6674cc172b56536f71eb007cd144607c953026a433abcf43d85c22299b8c83

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
2
Signaturschlüssel, die es gebaut haben
2
Deklarierte Umgebung elixir 1 linux x64 elixir 1 elixir mix

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
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

Fall

MIGRATION
Ziel
Decide whether the built-in JSON module in Elixir 1.18+ can replace Jason, and migrate without breaking rescue clauses
Pakete
Symbole
  • JSON.encode!
  • JSON.decode
  • JSON.encode_to_iodata!
  • Jason.decode!
  • Jason.DecodeError
  • JSON.DecodeError
Umgebung
elixir 1
Erstellt
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

Dateien

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

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

anonymous