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:
@@ -7,10 +7,16 @@
|
||||
"properties": {
|
||||
"command": { "const": "NICK" },
|
||||
"from": { "type": "string", "description": "Old nick (S2C)." },
|
||||
"body": { "type": "string", "description": "New nick.", "minLength": 1, "maxLength": 32, "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$" }
|
||||
"body": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "New nick (single-element array).",
|
||||
"minItems": 1,
|
||||
"maxItems": 1
|
||||
}
|
||||
},
|
||||
"required": ["command", "body"],
|
||||
"examples": [
|
||||
{ "command": "NICK", "from": "oldnick", "body": "newnick" }
|
||||
{ "command": "NICK", "from": "oldnick", "body": ["newnick"] }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user