mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-22 03:14:10 +01:00
For cases where event schema specify `patternProperties` it would be nice
to give that pattern a "human-readable" form rather than a raw regex. This
is now supported by specifying `x-pattern` in the value part of the specified
pattern e.g. `patternProperties:{ "^.*":{ x-pattern: "$THING", ... } }`
Templating had limited record type descriptions limited to value primitives
e.g. `{string: integer}`. It now supports inspecting the values recursively
if the value is `object`.
Updated `m.receipt` to take both these points into account to make it read
better. Tweak receipt module text.
46 lines
1.8 KiB
Plaintext
46 lines
1.8 KiB
Plaintext
{
|
|
"type": "object",
|
|
"title": "Receipt Event",
|
|
"description": "Informs the client of new receipts.",
|
|
"properties": {
|
|
"content": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^\\$": {
|
|
"type": "object",
|
|
"x-pattern": "$EVENT_ID",
|
|
"description": "The mapping of event ID to receipt type. The event ID is the ID which the receipts relate to and *not* an ID for the receipt itself. The key in the object is an enum which must be ``read``.",
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"title": "Users",
|
|
"patternProperties": {
|
|
"^@": {
|
|
"type": "object",
|
|
"title": "Receipt",
|
|
"description": "The mapping of user ID to receipt. The user ID is the entity who sent this receipt.",
|
|
"x-pattern": "$USER_ID",
|
|
"properties": {
|
|
"ts": {
|
|
"type": "number",
|
|
"description": "The timestamp the receipt was sent at"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["m.receipt"]
|
|
},
|
|
"room_id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": ["room_id", "type", "content"]
|
|
}
|