Skip to content

Instantly share code, notes, and snippets.

@mausch
Last active October 21, 2019 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mausch/e8ecac2436b484025bc95ea0dc711180 to your computer and use it in GitHub Desktop.
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
#!/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
@mausch
Copy link
Author

mausch commented Oct 21, 2019

@mausch
Copy link
Author

mausch commented Oct 21, 2019

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