Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
src
.DS_Store
.editorconfig
.gitignore
README.md
package-lock.json
package.json

README.md

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

You can’t perform that action at this time.