docs: add JSON Schema definitions for all message types (draft 2020-12)
C2S (7): send, join, part, nick, topic, mode, ping
S2C (12): message, dm, notice, join, part, quit, nick, topic, mode, system, error, pong
S2S (6): relay, link, unlink, sync, ping, pong
Each message type has its own schema file under schema/{c2s,s2c,s2s}/.
schema/README.md provides an index of all types with descriptions.
This commit is contained in:
33
schema/s2c/error.json
Normal file
33
schema/s2c/error.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://git.eeqj.de/sneak/chat/schema/s2c/error.json",
|
||||
"title": "S2C Error",
|
||||
"description": "Error message delivered via the message stream.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"const": "error"
|
||||
},
|
||||
"ts": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"code": {
|
||||
"type": "string",
|
||||
"description": "Machine-readable error code.",
|
||||
"examples": ["nick_in_use", "no_such_channel", "not_on_channel", "permission_denied"]
|
||||
},
|
||||
"content": {
|
||||
"type": "string",
|
||||
"description": "Human-readable error message."
|
||||
},
|
||||
"channel": {
|
||||
"type": "string",
|
||||
"description": "Related channel, if applicable."
|
||||
}
|
||||
},
|
||||
"required": ["id", "type", "ts", "code", "content"]
|
||||
}
|
||||
Reference in New Issue
Block a user