Use patternProperties in more places with supported formats (#1813)

Allows to have more places where the property name's type is better defined.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-05-08 15:59:17 +02:00 committed by GitHub
parent df1e799c51
commit b0df8e7fb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 489 additions and 407 deletions

View file

@ -51,13 +51,15 @@ allOf:
The contents of the messages to be sent. These are arranged in
a map of user IDs to a map of device IDs to message bodies.
The device ID may also be `*`, meaning all known devices for the user.
additionalProperties:
type: object
title: User Devices
additionalProperties:
patternProperties:
"^@":
x-pattern-format: mx-user-id
type: object
title: Device Message Contents
properties: {}
title: User Devices
additionalProperties:
type: object
title: Device Message Contents
properties: {}
example: {
"@alice:example.org": {
"IWHQUZUIAH": {

View file

@ -33,54 +33,58 @@ allOf:
description: |-
Receipts for a particular room. The string key is the room ID for
which the receipts under it belong.
additionalProperties:
type: object
title: Room Receipts
properties:
# We strongly define the receipt type to help spec future ones later
# on. At that point, m.read can become optional (maybe).
"m.read":
type: object
description: |-
Read receipts for users in the room. The string key is the user
ID the receipt belongs to.
additionalProperties:
patternProperties:
"^!":
x-pattern-format: mx-room-id
type: object
title: Room Receipts
properties:
# We strongly define the receipt type to help spec future ones later
# on. At that point, m.read can become optional (maybe).
"m.read":
type: object
title: User Read Receipt
properties:
event_ids:
type: array
description: |-
The extremity event IDs that the user has read up to.
minItems: 1
maxItems: 1
items:
type: string
example: ['$read_this_event:matrix.org']
data:
description: |-
Read receipts for users in the room. The string key is the user
ID the receipt belongs to.
patternProperties:
"^@":
x-pattern-format: mx-user-id
type: object
description: Metadata for the read receipt.
title: Read Receipt Metadata
title: User Read Receipt
properties:
ts:
type: integer
format: int64
event_ids:
type: array
description: |-
A POSIX timestamp in milliseconds for when the user read
the event specified in the read receipt.
example: 1533358089009
thread_id:
The extremity event IDs that the user has read up to.
minItems: 1
maxItems: 1
items:
type: string
x-addedInMatrixVersion: "1.4"
description: |-
The root thread event's ID (or `main`) for which
thread this receipt is intended to be under. If
not specified, the read receipt is *unthreaded*
(default).
example: "$threadroot"
required: ['ts']
required: ['event_ids', 'data']
required: ['m.read']
example: ['$read_this_event:matrix.org']
data:
type: object
description: Metadata for the read receipt.
title: Read Receipt Metadata
properties:
ts:
type: integer
format: int64
description: |-
A POSIX timestamp in milliseconds for when the user read
the event specified in the read receipt.
example: 1533358089009
thread_id:
type: string
x-addedInMatrixVersion: "1.4"
description: |-
The root thread event's ID (or `main`) for which
thread this receipt is intended to be under. If
not specified, the read receipt is *unthreaded*
(default).
example: "$threadroot"
required: ['ts']
required: ['event_ids', 'data']
required: ['m.read']
example: {
"!some_room:example.org": {
"m.read": {