feat: define realtime and error contracts
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://trixie.invalid/contracts/v1/error.json",
|
||||
"title": "Trixie API Error",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["code", "message", "request_id"],
|
||||
"properties": {
|
||||
"code": { "type": "string", "pattern": "^[a-z0-9_]+$" },
|
||||
"message": { "type": "string", "minLength": 1 },
|
||||
"request_id": { "type": "string", "minLength": 1 }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://trixie.invalid/contracts/v1/realtime-event.json",
|
||||
"title": "Trixie Realtime Event",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["event_id", "event_type", "occurred_at", "payload"],
|
||||
"properties": {
|
||||
"event_id": { "type": "string", "minLength": 1 },
|
||||
"event_type": { "type": "string", "pattern": "^[a-z0-9_.-]+$" },
|
||||
"occurred_at": { "type": "string", "format": "date-time" },
|
||||
"payload": { "type": "object" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user