avrotize

Crates.ioavrotize
lib.rsavrotize
version0.1.1
created_at2025-09-05 14:58:33.90066+00
updated_at2025-09-10 13:36:53.385252+00
descriptionConvert JSON Schema to Avro with Rust
homepagehttps://github.com/lmmx/avrotize-rs
repositoryhttps://github.com/lmmx/avrotize-rs
max_upload_size
id1825663
size421,301
Louis Maddox (lmmx)

documentation

https://docs.rs/avrotize

README

avrotize

Rust port of avrotize, a tool to convert JSON Schema into Apache Avro schemas.

✨ Overview

avrotize-rs is a high-performance converter that reads JSON Schema documents and produces equivalent Avro schema files. It aims to be feature-complete with the original Python avrotize, while leveraging Rust’s speed, memory safety, and ecosystem.

Supported features include:

  • ✅ Object → Avro record
  • ✅ Arrays → Avro array
  • $defs and $ref resolution
  • ✅ Enums (enum) and constants (const)
  • ✅ Required vs optional → nullable unions in Avro
  • ✅ Descriptions → Avro doc fields
  • ✅ Maps (additionalProperties)
  • ✅ Composition (oneOf, anyOf, allOf)
  • For unsupported features see roadmap

🚀 Usage

Convert a JSON Schema file to Avro:

cargo run -F cli
Usage: jsonschema2avro <JSONSCHEMA> <AVRO>

🧪 Tests

Fixtures live under tests/fixtures/jsonschema/.

For each fixture, an Avro schema is generated into tests/fixtures/avro/ and compared against a snapshot in tests/snapshots/.

📋 Roadmap

  • More robust external $ref resolution
  • Additional Avro features (fixed, logical types)

Acknowledgements

Commit count: 25

cargo fmt