Skip to content

lmmx/avrotize-rs

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •