Summary

This PR adds MessagePack binary serialization support to ZIO Blocks, porting the functionality from zio-schema-msgpack to the new ZIO Schema 2 architecture.

Changes

  • New module: schema-messagepack

    • MessagePackBinaryCodec[A] - Abstract class extending BinaryCodec[A] for MessagePack encoding/decoding
    • MessagePackFormat - Binary format with Deriver[MessagePackBinaryCodec] for automatic codec derivation
  • Supported types:

    • All primitive types (Unit, Boolean, Byte, Short, Int, Long, Float, Double, Char, String)
    • Numeric types (BigInt, BigDecimal)
    • Date/Time types (Instant, LocalDate, LocalDateTime, LocalTime, Duration, Period, etc.)
    • UUID, Currency
    • Records (case classes) - encoded as MessagePack maps
    • Variants (sealed traits) - encoded with _type discriminator field
    • Sequences (List, Vector, etc.) - encoded as MessagePack arrays
    • Maps - encoded as MessagePack maps
    • Wrapper types
    • DynamicValue
  • Dependencies:

    • org.msgpack:msgpack-core:0.9.8

Example Usage

import zio.blocks.schema._
import zio.blocks.schema.messagepack.MessagePackFormat
case class Person(name: String, age: Int)
implicit val schema: Schema[Person] = Schema.derived
val codec = schema.derive(MessagePackFormat.deriver)
val person = Person("Alice", 30)
val bytes = codec.encode(person)
val decoded = codec.decode(bytes) // Right(Person("Alice", 30))

Test Plan

  • Round-trip tests for all primitive types
  • Round-trip tests for records (simple, nested, with optional fields)
  • Round-trip tests for variants (sealed traits)
  • Round-trip tests for sequences (List, Vector)
  • Round-trip tests for maps
  • CI checks pass

Related Issues

/claim #682

Closes #682

Claim

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

Contributors

PA

Pavan Kumar

@ascender1729

100%

Sponsors

ZI

ZIO

@ZIO

$1,000