json-schema-to-avro
Converts JSON Schema definitions into Avro Schema definitions.
Install
npm install json-schema-to-avro
Consume
const jsonSchemaAvro = const inJson = "$id": "http://your-domain.com/schemas/your-schema.json" "description": "Example description" "type": "object" "properties": "first_name": "type": "string" "address": "type": "object" "properties": "street_address": "type": "string" const avro = jsonSchemaAvro
Please ensure that the input JSON schema is dereferenced so that all external references have been resolved. json-schema-ref-parser can do this, prior to using this module.
Test
npm test
TODO
- Handle
anyOf
andallOf
.