RESOURCE SCHEMA · CC BY 4.0 Source Event schema
{
"type": "object",
"additionalProperties": true,
"required": [
"name",
"description",
"consumers",
"values",
"subject"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"description": "Resource name, unique among Event resources in this System. Used exactly in filenames and references.",
"pattern": "^[A-Za-z0-9_-]+$"
},
"description": {
"type": "string",
"minLength": 20,
"maxLength": 4000,
"description": "Business-facing explanation of what this resource represents, why it exists and how it is used."
},
"subject": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,239}$",
"description": "Stable message subject. Use a domain event name, not a transport or implementation name."
},
"producer": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$",
"description": "Exact name of the local producer Process. Omit when the producer is outside this System.",
"minLength": 1
},
"consumers": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"process",
"inputMapping"
],
"properties": {
"process": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$",
"description": "Exact name of the referenced resource, unique within its resource type in this System.",
"minLength": 1
},
"inputMapping": {
"type": "object",
"minProperties": 1,
"description": "Map every required consumer Process Input to payload.<EventValue>. Nested payload paths are allowed.",
"additionalProperties": {
"type": "string",
"pattern": "^payload\\.[A-Za-z][A-Za-z0-9_.-]*$"
}
}
},
"description": "Local consumer Process with its explicit payload-to-Input mapping."
},
"description": "Local consuming Processes. Empty when consumers are outside this System."
},
"values": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": true,
"required": [
"name",
"type",
"description",
"label"
],
"description": "A concrete business value with a meaningful name and description. Object and array values require a JSON schema describing the actual contents. Use integer or long for whole numbers and decimal for fractional values. AIScript defines their calculation and conversion rules.",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"type": {
"type": "string",
"enum": [
"string",
"String",
"STRING",
"text",
"Text",
"TEXT",
"integer",
"Integer",
"INTEGER",
"long",
"Long",
"LONG",
"decimal",
"Decimal",
"DECIMAL",
"boolean",
"Boolean",
"BOOLEAN",
"date",
"Date",
"DATE",
"datetime",
"Datetime",
"DATETIME",
"object",
"Object",
"OBJECT",
"array",
"Array",
"ARRAY",
"file",
"File",
"FILE",
"reference",
"Reference",
"REFERENCE"
],
"description": "Case-insensitive; normalizes this value to lowercase."
},
"description": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"required": {
"type": "boolean"
},
"minimum": {
"type": "number"
},
"maximum": {
"type": "number"
},
"minLength": {
"type": "integer",
"minimum": 0
},
"maxLength": {
"type": "integer",
"minimum": 0
},
"values": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {},
"description": "Allowed field values, chosen by the System author. Each value follows the field type. Omit when there is no fixed list."
},
"source": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$",
"description": "Exact name of the referenced resource, unique within its resource type in this System.",
"minLength": 1
},
"receiver": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$",
"description": "Exact name of the referenced resource, unique within its resource type in this System.",
"minLength": 1
},
"collection": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]+$",
"minLength": 1,
"maxLength": 160,
"description": "For a reference value, the singular name of the referenced Data Collection."
},
"schema": {
"type": "object",
"additionalProperties": true,
"description": "Required for object and array values. Describe concrete properties or items so the contract can be compiled."
},
"classification": {
"type": "string",
"enum": [
"public",
"internal",
"confidential",
"restricted"
]
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"personal-data",
"cardholder-data",
"sensitive-authentication-data",
"financial-data",
"other-regulated-data"
]
}
},
"handling": {
"type": "object",
"additionalProperties": false,
"properties": {
"storage": {
"type": "string",
"enum": [
"none",
"transient",
"persistent"
]
},
"retention": {
"type": "string",
"maxLength": 500
},
"disposal": {
"type": "string",
"maxLength": 1000
},
"protections": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"encryption",
"tokenization",
"masking",
"redaction",
"access-control",
"audit-logging"
]
}
}
}
},
"label": {
"type": "string",
"minLength": 1,
"description": "Human-readable display label. The name remains the code and mapping key."
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "reference"
}
},
"required": [
"type"
]
},
"then": {
"required": [
"collection"
]
}
}
]
}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Event.schema.json",
"description": "One Event: a typed fact emitted or consumed by Processes, with payload-to-Input mappings.",
"$id": "Event.schema.json",
"not": {
"required": [
"id"
]
}
}