Files
model-platform/contracts/events/event-envelope-v1.json
T

73 lines
1.5 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "event-envelope-v1.json",
"title": "Model Platform Event Envelope V1",
"description": "MySQL Outbox 中所有内部业务事件共用的不可变信封。",
"type": "object",
"additionalProperties": false,
"required": [
"event_id",
"event_type",
"schema_version",
"occurred_at",
"producer",
"trace_id",
"aggregate_type",
"aggregate_id",
"idempotency_key",
"payload"
],
"properties": {
"event_id": {
"$ref": "#/$defs/ulid"
},
"event_type": {
"type": "string",
"pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9_]*)+$"
},
"schema_version": {
"const": 1
},
"occurred_at": {
"type": "string",
"format": "date-time"
},
"producer": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"trace_id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"aggregate_type": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"aggregate_id": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"idempotency_key": {
"type": "string",
"minLength": 8,
"maxLength": 128
},
"payload": {
"type": "object"
}
},
"$defs": {
"ulid": {
"type": "string",
"minLength": 26,
"maxLength": 26,
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
}
}
}