Last active
October 21, 2019 14:21
-
-
Save mausch/e8ecac2436b484025bc95ea0dc711180 to your computer and use it in GitHub Desktop.
Checks Avro compatibility between a schema stored in a Confluent schema registry and a schema stored in a local file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
tmpfile="current-schema.avro" | |
SCHEMA_REGISTRY_URL="${SCHEMA_REGISTRY_URL:-http://elevate.kafka.local:8081}" | |
curl -s $SCHEMA_REGISTRY_URL/subjects/${2}-value/versions/latest | jq '.schema' -r | jq '' > $tmpfile | |
trap "rm $tmpfile" INT TERM HUP EXIT | |
~/avro-check.sh check --old-schema /work/$tmpfile --new-schema /work/$1 |
This workaround is necessary because the compatibility checks in Confluent's schema registry are completely broken and nobody cares.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
avro-check.sh
defined in https://gist.github.com/mausch/c69962e8c5a1462e181224e852761259