Clarify user avatar_urls to always use MXC URIs (#2422)
Some checks failed
Spec / 🔎 Validate OpenAPI specifications (push) Has been cancelled
Spec / 🔎 Check Event schema examples (push) Has been cancelled
Spec / 🔎 Check OpenAPI definitions examples (push) Has been cancelled
Spec / 🔎 Check JSON Schemas inline examples (push) Has been cancelled
Spec / ⚙️ Calculate baseURL for later jobs (push) Has been cancelled
Spec / 📢 Run towncrier for changelog (push) Has been cancelled
Spell Check / Spell Check with Typos (push) Has been cancelled
Spec / 🐍 Build OpenAPI definitions (push) Has been cancelled
Spec / 📖 Build the spec (push) Has been cancelled
Spec / 🔎 Validate generated HTML (push) Has been cancelled
Spec / 📖 Build the historical backup spec (push) Has been cancelled
Spec / Create release (push) Has been cancelled

Previously the spec would use a mix of `string`, `URI`
and `MXC URI` for values of a user's `avatar_url` in
different apis (like `m.room.member`, `m.presence`,
CS profile endpoints).

This clarification updates all occurances to be MXC URIs,
prompted by https URIs `m.room.member#avatar_url` events
in the wild.

Signed-off-by: networkException <git@nwex.de>
This commit is contained in:
networkException 2026-07-17 13:27:19 +02:00 committed by GitHub
parent f9dec5dc92
commit 4c2bb5aae1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 15 additions and 5 deletions

View file

@ -0,0 +1 @@
Use MXC URI type for all user `avatar_url` fields. Contributed by @networkException.

View file

@ -54,7 +54,8 @@ properties:
example: true
avatar_url:
type: string
format: uri
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
description: The URL for the room's avatar, if one is set.
example: "mxc://example.org/abcdef"
join_rule:

View file

@ -340,7 +340,8 @@ paths:
description: The display name of the user this object is representing.
avatar_url:
type: string
format: uri
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
description: The avatar of the user this object is representing, as an [`mxc://`
URI](/client-server-api/#matrix-content-mxc-uris).
description: A map from user ID to a RoomMember object.

View file

@ -238,7 +238,8 @@ paths:
title: Display name
avatar_url:
type: string
format: uri
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
title: Avatar Url
events_before:
type: array

View file

@ -90,7 +90,8 @@ paths:
description: The display name of the user, if one exists.
avatar_url:
type: string
format: uri
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
example: mxc://bar.com/foo
description: The avatar url, as an [`mxc://`
URI](/client-server-api/#matrix-content-mxc-uris),

View file

@ -172,6 +172,8 @@ paths:
example: John Doe
avatar_url:
type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
description: |-
The avatar URL for the user's avatar. MUST either be omitted or set to
`null` if the user does not have an avatar set.

View file

@ -12,6 +12,8 @@
"properties": {
"avatar_url": {
"type": "string",
"format": "mx-mxc-uri",
"pattern": "^mxc:\\/\\/",
"description": "The current avatar URL for this user, if any."
},
"displayname": {

View file

@ -53,7 +53,8 @@ properties:
avatar_url:
description: 'The avatar URL for this user, if any.'
type: string
format: uri
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
displayname:
description: 'The display name for this user, if any.'
type: