avro-stitch
avro-stitch ===========
Last updated 3 months ago by notid1 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install avro-stitch 
SYNC missed versions from official npm registry.

avro-stitch

oclif Version Downloads/week License

Avro supports the abilities to reference other schemas, but confluent's schema registry doesn't allow you to reference one schema from another. To better support this use case, this tool will take a directory of .avsc files, each with a single record type in them, and a root entity, and will output one .avsc with everything in it. Avro has specific rules about defining a record type before using it, and this tool will ensure that those rules are respected.

Usage

Imagine the following:

a.avsc:

{
    "name": "A",
    "type": "record",
    "fields": [
        {
            "name": "b",
            "type": "B"
        }
    ]
}

b.avsc

{
    "name": "B",
    "type": "record",
    "fields": [
        {
            "name": "a",
            "type": "A"
        }
    ]
}

If you ran avro-stitch this way:

$ avro-stitch -d ~/dev/schemas -r A -o target.avsc

You'd get this output:

target.avsc

{
    "name": "A",
    "type": "record",
    "fields": [
        {
            "name": "b",
            "type": {
              "name": "B",
              "type": "record",
              "fields": [
                  {
                      "name": "a",
                      "type": "A"
                  }
              ]
          }
        }
    ]
}

target.avsc should be usable in confluent's schema registry.

Commands

Current Tags

  • 0.1.2                                ...           latest (3 months ago)

4 Versions

  • 0.1.2                                ...           3 months ago
  • 0.1.1                                ...           3 months ago
  • 0.1.0                                ...           3 months ago
  • 0.0.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |