Add Apache Thrift Binary Codec Support to ZIO Schema 2

This PR adds Apache Thrift binary wire format support to ZIO Schema 2 (zio-blocks) by introducing a new module called schema-thrift.

It enables automatic serialization and deserialization of any type A with a Schema[A] to and from Thrift binary format using Apache Thrift’s TBinaryProtocol.

File Changes

zio-blocks/
├── schema-thrift/
│ ├── README.md
│ └── src/
│ ├── main/
│ │ └── scala/zio/blocks/schema/thrift/
│ │ ├── ChunkTransport.scala
│ │ ├── ThriftBinaryCodec.scala
│ │ └── ThriftFormat.scala
│ └── test/
│ └── scala/zio/blocks/schema/thrift/
│ └── ThriftCodecSpec.scala
└── build.sbt

Features

  • Automatic Thrift binary encoding and decoding for any Schema[A]
  • Uses Apache Thrift TBinaryProtocol
  • No manual codec writing required
  • Fully compatible with existing ZIO Schema models

Tests

Includes a comprehensive test suite covering:

  • Primitive and time types
  • Records (including high-arity records)
  • Variants and enums
  • Collections
  • Recursive structures

Wire Compatibility Cases

  • Out-of-order fields
  • Sparse field IDs
  • Unknown field skipping for:
    • Strings
    • Structs
    • Lists
    • Maps

/claim #681 Fixes #681

Claim

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

Contributors

OR

Orbin Sunny

@orbin123

100%

Sponsors

ZI

ZIO

@ZIO

$1,000