refactor: structured body (array|object, never string) for canonicalization
Message bodies are always arrays of strings (text lines) or objects (structured data like PUBKEY). Never raw strings. This enables: - Multiline messages without escape sequences - Deterministic JSON canonicalization (RFC 8785 JCS) for signing - Structured data where needed Update all schemas: body fields use array type with string items. Update message.json envelope: body is oneOf[array, object], id is UUID. Update README: message envelope table, examples, and canonicalization docs. Update schema/README.md: field types, examples with array bodies.
This commit is contained in:
@@ -2,20 +2,46 @@
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://git.eeqj.de/sneak/chat/schema/numerics/403.json",
|
||||
"title": "403 ERR_NOSUCHCHANNEL",
|
||||
"description": "No such channel. RFC 1459 §6.1.",
|
||||
"description": "No such channel. RFC 1459 \u00a76.1.",
|
||||
"$ref": "../message.json",
|
||||
"properties": {
|
||||
"command": { "const": "403" },
|
||||
"to": { "type": "string" },
|
||||
"command": {
|
||||
"const": "403"
|
||||
},
|
||||
"to": {
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "[channel_name]."
|
||||
},
|
||||
"body": { "const": "No such channel" }
|
||||
"body": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "No such channel",
|
||||
"maxItems": 1
|
||||
}
|
||||
},
|
||||
"required": ["command", "to", "params"],
|
||||
"required": [
|
||||
"command",
|
||||
"to",
|
||||
"params"
|
||||
],
|
||||
"examples": [
|
||||
{ "command": "403", "to": "alice", "params": ["#nonexistent"], "body": "No such channel" }
|
||||
{
|
||||
"command": "403",
|
||||
"to": "alice",
|
||||
"params": [
|
||||
"#nonexistent"
|
||||
],
|
||||
"body": [
|
||||
"No such channel"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user