Files
go-sip/contracts/schema/common.schema.json
T

123 lines
2.6 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://go-sip.local/contracts/schema/common.schema.json",
"title": "Shared HTTP and MQ definitions; not a standalone message schema",
"$defs": {
"dispatcher_id": {
"type": "string",
"format": "uuid"
},
"tenant_id": {
"type": "integer",
"minimum": 1
},
"task_id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,128}$"
},
"error": {
"type": "object",
"additionalProperties": false,
"required": [
"resource",
"error"
],
"properties": {
"resource": {
"const": "error"
},
"error": {
"type": "object",
"additionalProperties": false,
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"message": {
"type": "string",
"minLength": 1
}
}
}
}
},
"weekly_windows": {
"type": "object",
"additionalProperties": false,
"required": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday",
"sunday"
],
"properties": {
"monday": {
"$ref": "#/$defs/windows"
},
"tuesday": {
"$ref": "#/$defs/windows"
},
"wednesday": {
"$ref": "#/$defs/windows"
},
"thursday": {
"$ref": "#/$defs/windows"
},
"friday": {
"$ref": "#/$defs/windows"
},
"saturday": {
"$ref": "#/$defs/windows"
},
"sunday": {
"$ref": "#/$defs/windows"
}
}
},
"windows": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"start",
"end"
],
"properties": {
"start": {
"type": "string",
"pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
},
"end": {
"type": "string",
"pattern": "^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
}
}
}
},
"event_id": {
"type": "string",
"minLength": 1
},
"issued_at": {
"type": "string",
"format": "date-time"
},
"task_status": {
"enum": [
"running",
"paused",
"stopped"
]
}
}
}