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,19 +2,36 @@
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://git.eeqj.de/sneak/chat/schema/numerics/001.json",
|
||||
"title": "001 RPL_WELCOME",
|
||||
"description": "Welcome message sent after successful session creation. RFC 2812 §5.1.",
|
||||
"description": "Welcome message sent after successful session creation. RFC 2812 \u00a75.1.",
|
||||
"$ref": "../message.json",
|
||||
"properties": {
|
||||
"command": { "const": "001" },
|
||||
"to": { "type": "string", "description": "Target nick." },
|
||||
"command": {
|
||||
"const": "001"
|
||||
},
|
||||
"to": {
|
||||
"type": "string",
|
||||
"description": "Target nick."
|
||||
},
|
||||
"body": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Welcome text lines."
|
||||
}
|
||||
},
|
||||
"required": ["command", "to", "body"],
|
||||
"required": [
|
||||
"command",
|
||||
"to",
|
||||
"body"
|
||||
],
|
||||
"examples": [
|
||||
{ "command": "001", "to": "alice", "body": ["Welcome to the network, alice"] }
|
||||
{
|
||||
"command": "001",
|
||||
"to": "alice",
|
||||
"body": [
|
||||
"Welcome to the network, alice"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user