Summary

Port BSON support from ZIO Schema v1 to ZIO Schema 2 in a new top-level schema-bson project.

Implementation includes:

  • BsonBinaryCodec abstract class extending BinaryCodec[A]
  • BsonFormat object with Deriver[BsonBinaryCodec]
  • Support for all 30 primitive types (Unit, Boolean, Byte, Short, Int, Long, Float, Double, Char, String, BigInt, BigDecimal, all java.time types, Currency, UUID)
  • Record, variant, sequence, map, dynamic value, and wrapper support
  • Recursive type support via lazy initialization
  • Comprehensive test suite with 135 tests

Deriver Methods Implemented:

  • derivePrimitive - All primitive types
  • deriveRecord - Case classes encoded as BSON documents
  • deriveVariant - Sealed traits with discriminator field
  • deriveSequence - Collections encoded as BSON arrays
  • deriveMap - Maps encoded as BSON documents (string keys) or arrays (non-string keys)
  • deriveDynamic - DynamicValue support
  • deriveWrapper - Wrapper types with validation

Dependencies:

  • org.mongodb:bson:5.2.0

Test plan

  • All 135 tests pass
  • Format check passes
  • Compiles against latest main

/claim #683

Claim

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

Contributors

HA

hartmade

@hartmade

100%

Sponsors

ZI

ZIO

@ZIO

$1,000