This PR adds JSON encoding and decoding support derived from Schema[A] using DynamicValue as the intermediate representation. #679

Summary

  • Introduces a minimal Json ADT for representing JSON values

  • Adds JsonEncoder[A] and JsonDecoder[A] typeclasses

  • Provides schema-based derivation following the existing pattern:

    Schema[A] ⇄ DynamicValue ⇄ Json

  • No Deriver / no reflection / no registers

  • Does not modify Schema itself

  • Implementation is small, explicit, and consistent with the current codec design

Design Notes

  • DynamicValue is the authority for encoding/decoding; Schema drives correctness
  • A small structural heuristic is used when converting JSON → DynamicValue (single-field uppercase keys treated as variants).
    This is validated by schema.fromDynamicValue, so incorrect cases fail safely.
  • Scope is intentionally limited to codec derivation only (per issue #679)

Tests

Added focused tests covering:

  • Simple and nested case class round-trips
  • Optional fields
  • Failure cases with clear errors
  • All tests pass on JVM and JS

Status

  • Code formatted (scalafmtCheckAll)
  • Full test suite passing
  • Ready for maintainer review

/claim #679

Claim

Total prize pool $4,000
Total paid $0
Status Pending
Submitted January 15, 2026
Last updated January 15, 2026

Contributors

AK

Akshat Thakur

@Akshatthakur22

100%

Sponsors

ZI

ZIO

@ZIO

$2,000
JA

Jacques Anidjar

@jacanidjar

$2,000