jsonschema-avro 3.1.1
Install from the command line:
Learn more about npm packages
$ npm install @deepcrawl/jsonschema-avro@3.1.1
Install via package.json:
"@deepcrawl/jsonschema-avro": "3.1.1"
About this version
Converts JSON-schema definitions into Avro definitions.
npm install jsonschema-avro
const jsonSchemaAvro = require('jsonschema-avro')
const inJson = {
"description": "Example description",
"type": "object",
"properties": {
"first_name": { "type": "string" },
"address": {
"type": "object",
"properties": {
"street_address": { "type": "string" }
}
}
}
}
const avro = jsonSchemaAvro.convert(inJson)
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.
Avro schema documentation can be found here:
https://docs.oracle.com/cd/E26161_02/html/GettingStartedGuide/avroschemas.html
To run all tests:
npm test
To run a single test, using the name of the sample:
ONLY=optional npm test
CI uses the following script:
npm run ci
Please run this on your local machine to ensure CI will pass.
This project uses prettier, to format source files run:
npm run format
Please keep the integration tests to a single test per file for readability.
- Handle
anyOf
andallOf
.
Details
- jsonschema-avro
-
deepcrawl
- 10 months ago
- MIT
- 21 dependencies
Assets
- jsonschema-avro-3.1.1.tgz
Download activity
- Total downloads 33,196
- Last 30 days 2,673
- Last week 494
- Today 3