Schema Registry
JSON Schema definitions are stored under the server data directory and validated before append when an event carries schema name/version.
Register
Section titled “Register”./bin/chronacta schema register \ -name order-created \ -version 1 \ -file order-created.schema.json \ -compatibility noneCompatibility modes (checked against the latest previous version of the same name):
| Mode | Meaning |
|---|---|
none |
No evolution check (default) |
backward |
New schema can read data written with the previous schema |
forward |
Previous schema can read data written with the new schema |
full |
Both backward and forward |
Other commands
Section titled “Other commands”./bin/chronacta schema get -name order-created -version 1./bin/chronacta schema list./bin/chronacta schema validate -name order-created -version 1 -data '{"order_id":"1"}'Append with schema metadata:
./bin/chronacta append -stream orders-1 -type OrderCreated \ -data '{"order_id":"1"}' \ -schema-name order-created -schema-version 1 \ -expected-version -2
