Converts JSON Schema definitions into Apache Avro schema format. Version 1.1.0 is the current stable release. The library is lightweight and has minimal dependencies (only tslib). It supports basic JSON Schema types and structures but does not handle advanced features like anyOf or allOf. The input must be fully dereferenced before conversion. It provides a simple API with a single convert function and ships with TypeScript type definitions.
npm install json-schema-to-avroNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates converting a simple JSON Schema object to an Avro schema using the convert function.
Use json-schema-ref-parser or similar to resolve external references before calling convert.
Manually transform schemas using anyOf/allOf into supported constructs or consider an alternative library.
Ensure input schema is compliant with draft-04 or earlier.
Update imports to use the convert function as shown in documentation.
Use require('json-schema-to-avro').convert or import { convert } from 'json-schema-to-avro'.Ensure type is one of: null, boolean, int, long, float, double, bytes, string, record, enum, array, map, union, fixed.
Resolve all references using json-schema-ref-parser or similar before conversion.
Install tslib: npm install tslib