Clarify string formats of event endpoints and schemas

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2026-03-30 17:58:24 +02:00
parent 2192bfa996
commit d601884378
No known key found for this signature in database
GPG key ID: F26F4BE20A08255B
23 changed files with 99 additions and 8 deletions

View file

@ -24,8 +24,9 @@ allOf:
room_id:
description: The ID of the room associated with this event.
type: string
format: mx-room-id
pattern: "^!"
example: '!jEsUZKDJdhlrceRyVU:example.org'
unsigned:
properties:
redacted_because:
@ -43,6 +44,6 @@ allOf:
"unsigned": {
"age": 1257,
}
}
}
required:
- room_id

View file

@ -28,6 +28,8 @@ properties:
event_id:
description: The globally unique identifier for this event.
type: string
format: mx-event-id
pattern: "^\\$"
example: '$26RqwJMLw-yds1GAH_QxjHRC1Da9oasK0e5VLnck_45'
type:
description: The type of the event.
@ -47,6 +49,8 @@ properties:
sender:
description: Contains the fully-qualified ID of the user who sent this event.
type: string
format: mx-user-id
pattern: "^@"
example: "@example:example.org"
origin_server_ts:
description: |-

View file

@ -39,5 +39,7 @@ properties:
such.
event_id:
type: string
format: mx-event-id
pattern: "^\\$"
description: The event ID of the event that this event relates to.
required: ['rel_type', 'event_id']

View file

@ -37,6 +37,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: query
name: from
x-changedInMatrixVersion:

View file

@ -148,6 +148,8 @@ paths:
properties:
room_id:
type: string
format: mx-room-id
pattern: "^!"
description: The ID of this room.
membership:
type: string
@ -337,6 +339,8 @@ paths:
example: $asfDuShaf7Gafaw:matrix.org
schema:
type: string
format: mx-event-id
pattern: "^\\$"
responses:
"200":
description: The full event.

View file

@ -43,13 +43,17 @@ paths:
example: "!637q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: path
name: eventId
description: The ID of the event to redact
description: The ID of the event to redact.
required: true
example: bai2b1i9:matrix.org
example: $bai2b1i9:matrix.org
schema:
type: string
format: mx-event-id
pattern: "^\\$"
- in: path
name: txnId
description: |-
@ -82,6 +86,8 @@ paths:
properties:
event_id:
type: string
format: mx-event-id
pattern: "^\\$"
description: A unique identifier for the event.
examples:
response:

View file

@ -233,6 +233,8 @@ components:
example: "!636q39766251:matrix.org"
schema:
type: string
format: mx-room-id
pattern: "^!"
eventId:
in: path
name: eventId
@ -241,6 +243,8 @@ components:
example: $asfDuShaf7Gafaw
schema:
type: string
format: mx-event-id
pattern: "^\\$"
from:
in: query
name: from

View file

@ -56,6 +56,8 @@ paths:
example: "!636q39766251:matrix.org"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: query
name: ts
description: |-
@ -86,6 +88,8 @@ paths:
properties:
event_id:
type: string
format: mx-event-id
pattern: "^\\$"
description: The ID of the event found
origin_server_ts:
type: integer

View file

@ -27,6 +27,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
responses:
"200":
description: The current state of the room
@ -38,6 +40,8 @@ paths:
properties:
room_id:
type: string
format: mx-room-id
pattern: "^!"
description: The ID of this room.
membership:
type: string

View file

@ -49,6 +49,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: path
name: eventType
description: The type of event to send.
@ -86,6 +88,8 @@ paths:
properties:
event_id:
type: string
format: mx-event-id
pattern: "^\\$"
description: A unique identifier for the event.
required:
- event_id

View file

@ -49,6 +49,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: path
name: eventType
description: The type of event to send.
@ -86,6 +88,8 @@ paths:
properties:
event_id:
type: string
format: mx-event-id
pattern: "^\\$"
description: A unique identifier for the event.
required:
- event_id

View file

@ -34,6 +34,8 @@ paths:
example: "!636q39766251:matrix.org"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: path
name: eventId
description: The event ID to get.
@ -41,6 +43,8 @@ paths:
example: $asfDuShaf7Gafaw:matrix.org
schema:
type: string
format: mx-event-id
pattern: "^\\$"
responses:
"200":
description: The full event.
@ -89,6 +93,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: path
name: eventType
description: The type of state to look up.
@ -158,6 +164,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
responses:
"200":
description: The current state of the room
@ -211,6 +219,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
- in: query
name: at
description: |-
@ -305,6 +315,8 @@ paths:
example: "!636q39766251:example.com"
schema:
type: string
format: mx-room-id
pattern: "^!"
security:
- accessTokenQuery: []
- accessTokenBearer: []

View file

@ -209,6 +209,8 @@ paths:
field may be omitted.
items:
type: string
format: mx-user-id
pattern: "^@"
m.joined_member_count:
type: integer
description: |-

View file

@ -20,10 +20,13 @@ properties:
The signatures are calculated using the process described at
[Signing JSON](/appendices/#signing-json).
type: object
additionalProperties:
type: object
additionalProperties:
type: string
patternProperties:
"":
x-pattern-format: mx-server-name
type: object
additionalProperties:
type: string
format: mx-unpadded-base64
example: {
"magic.forest": {
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"

View file

@ -11,5 +11,7 @@ allOf:
The ID of the room associated with this event. Will not be present on events
that arrive through `/sync`, despite being required everywhere else.
type: string
format: mx-room-id
pattern: "^!"
required:
- room_id

View file

@ -39,6 +39,8 @@ properties:
sender:
description: The `sender` for the event.
type: string
format: mx-user-id
pattern: "^@"
required:
- type
- state_key

View file

@ -29,9 +29,13 @@ allOf:
event_id:
description: The globally unique event identifier.
type: string
format: mx-event-id
pattern: "^\\$"
sender:
description: Contains the fully-qualified ID of the user who sent this event.
type: string
format: mx-user-id
pattern: "^@"
origin_server_ts:
description: Timestamp in milliseconds on originating homeserver
when this event was sent.

View file

@ -16,6 +16,8 @@ properties:
The canonical alias for the room. If not present, null, or empty the
room should be considered to have no canonical alias.
type: string
format: mx-room-alias
pattern: "^#"
alt_aliases:
description: |
Alternative aliases the room advertises. This list can have aliases
@ -23,6 +25,8 @@ properties:
type: array
items:
type: string
format: mx-room-alias
pattern: "^#"
type: object
state_key:
description: A zero-length string.

View file

@ -12,6 +12,8 @@ properties:
The `user_id` of the room creator. **Required** for, and only present in, room versions 1 - 10. Starting with
room version 11 the event `sender` should be used instead.
type: string
format: mx-user-id
pattern: "^@"
m.federate:
description: Whether users on other servers can join this room. Defaults to `true` if key does not exist.
type: boolean
@ -32,9 +34,13 @@ properties:
properties:
room_id:
type: string
format: mx-room-id
pattern: "^!"
description: The ID of the old room.
event_id:
type: string
format: mx-event-id
pattern: "^\\$"
deprecated: true
x-changedInMatrixVersion:
"1.16": |-
@ -51,6 +57,8 @@ properties:
type: array
items:
type: string
format: mx-user-id
pattern: "^@"
description: Additional user ID to consider a creator of the room, if supported by the room version.
x-addedInMatrixVersion: "1.16"
description: |-

View file

@ -55,6 +55,8 @@ properties:
enum: ['m.room_membership']
room_id:
type: string
format: mx-room-id
pattern: "^!"
description: |-
Required if `type` is `m.room_membership`. The room ID to check the
user's membership against. If the user is joined to this room, they

View file

@ -76,6 +76,8 @@ properties:
join_authorised_via_users_server:
x-addedInMatrixVersion: "1.2"
type: string
format: mx-user-id
pattern: "^@"
description: |-
Usually found on `join` events, this field is used to denote which homeserver (through
representation of a user with sufficient power level) authorised the user's join. More
@ -127,6 +129,8 @@ properties:
`join`, the user ID sending the event does not need to match the user ID in the `state_key`,
unlike other events. Regular authorisation rules still apply.
type: string
format: mx-user-id
pattern: "^@"
type:
enum:
- m.room.member

View file

@ -10,6 +10,8 @@ properties:
redacts:
description: The event ID that was redacted. Required for, and present starting in, room version 11.
type: string
format: mx-event-id
pattern: "^\\$"
reason:
description: 'The reason for the redaction, if any.'
type: string
@ -17,6 +19,8 @@ properties:
redacts:
description: Required for, and only present in, room versions 1 - 10. The event ID that was redacted.
type: string
format: mx-event-id
pattern: "^\\$"
type:
enum:
- m.room.redaction

View file

@ -66,6 +66,11 @@ mx-mxc-uri:
url: client-server-api#matrix-content-mxc-uris
# regex: "^mxc:\\/\\/"
mx-unpadded-base64:
title: Unpadded Base64
url: appendices#unpadded-base64
# no regex
uri:
title: URI
url: https://datatracker.ietf.org/doc/html/rfc3986