/claim #683

Feature: Full BSON Support for ZIO Schema 2 (Fixes #683)

This PR implements the schema-bson module providing robust BSON serialization for ZIO Schema.

Key Features

  • Generic Derivation: Support for primitives, case classes (Records), ADTs/Enums (Variants), Sequences, and Maps.
  • Recursion Safe: Implemented LazyBsonCodec to handle recursive types without StackOverflow.
  • Annotation Support: Responds to @name annotations for field renaming.
  • DynamicValue Handling: Implemented a custom “Envelope” codec ({ "type": "...", "value": ... }) to support generic DynamicValue round-trips and bypass BSON root-array limitations.

Verification

  • Added comprehensive test suite: BsonFormatSpec.
  • Status: 25/25 tests PASSED.
  • Validated complex recursive structures and dynamic generic types.

https://github.com/user-attachments/assets/5e85f307-13e2-41e8-bd38-13c07e7da1fd

image

Claim

Total prize pool $1,000
Total paid $0
Status Pending
Submitted January 18, 2026
Last updated January 18, 2026

Contributors

JA

Jacques Anidjar

@jacanidjar

100%

Sponsors

ZI

ZIO

@ZIO

$1,000