{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://github.com/GameCult/CultLib/contracts/cultnet/cultnet.database-change-raw.schema.json", "title": "CultNet Raw Database Change Message", "type": "object", "required": ["schemaVersion", "messageId", "subscriptionId", "changeKind"], "additionalProperties": false, "properties": { "schemaVersion": { "const": "cultnet.database_change_raw.v0" }, "messageId": { "type": "string", "minLength": 1 }, "subscriptionId": { "type": "string", "minLength": 1 }, "changeKind": { "enum": ["added", "updated", "removed"] }, "document": { "oneOf": [{ "type": "null" }, { "$ref": "./cultnet.raw-document-record.schema.json" }] }, "recordKey": { "type": ["string", "null"], "minLength": 1 }, "schemaId": { "type": ["string", "null"], "minLength": 1 }, "commitId": { "type": ["string", "null"], "minLength": 1 }, "commitCount": { "type": ["integer", "null"], "minimum": 2 } }, "oneOf": [ { "properties": { "changeKind": { "const": "removed" }, "recordKey": { "type": "string" }, "schemaId": { "type": "string" } }, "required": ["recordKey", "schemaId"] }, { "properties": { "changeKind": { "enum": ["added", "updated"] }, "document": { "$ref": "./cultnet.raw-document-record.schema.json" } }, "required": ["document"] } ] }