Compare commits

..

No commits in common. "7de46ddf9799c3c13ad369a7b42f7bcf88586648" and "0baab558ed34def4f5924f59b337701aa7350210" have entirely different histories.

14 changed files with 31 additions and 66 deletions

View file

@ -1,2 +0,0 @@
Update the canonical JSON grammar with case sensitive strings and ABNF builtins
to be easier to understand.

View file

@ -1 +0,0 @@
Clarify formats of string types.

View file

@ -131,37 +131,32 @@ def canonical_json(value):
#### Grammar #### Grammar
Adapted grammar from <http://tools.ietf.org/html/rfc7159> removing Adapted from the grammar in <http://tools.ietf.org/html/rfc7159>
insignificant whitespace, fractions, exponents and redundant character escapes removing insignificant whitespace, fractions, exponents and redundant
written in [ABNF](https://datatracker.ietf.org/doc/html/rfc5234) with character escapes.
[case sensitive strings](https://datatracker.ietf.org/doc/html/rfc7405).
``` value = false / null / true / object / array / number / string
value = false / null / true / object / array / number / string false = %x66.61.6C.73.65
false = %s"false" null = %x6E.75.6C.6C
null = %s"null" true = %x74.72.75.65
true = %s"true" object = %x7B [ member *( %x2C member ) ] %x7D
object = "{" [ member *( "," member ) ] "}" member = string %x3A value
member = string ":" value array = %x5B [ value *( %x2C value ) ] %x5D
array = "[" [ value *( "," value ) ] "]" number = [ %x2D ] int
number = [ "-" ] int int = %x30 / ( %x31-39 *digit )
int = %x30 / ( %x31-39 *DIGIT ) ; Integer without leading zeros digit = %x30-39
string = DQUOTE *char DQUOTE ; Quoted characters string = %x22 *char %x22
char = unescaped / "\" escaped char = unescaped / %x5C escaped
unescaped = %x20-21 / %x23-5B / %x5D-10FFFF ; All UTF-8 codepoints except ASCII control unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
; characters, " and \ escaped = %x22 ; " quotation mark U+0022
escaped = %x62 ; b backspace U+0008 / %x5C ; \ reverse solidus U+005C
/ %x74 ; t tab U+0009 / %x62 ; b backspace U+0008
/ %x6E ; n line feed U+000A / %x66 ; f form feed U+000C
/ %x66 ; f form feed U+000C / %x6E ; n line feed U+000A
/ %x72 ; r carriage return U+000D / %x72 ; r carriage return U+000D
/ %x22 ; " quotation mark U+0022 / %x74 ; t tab U+0009
/ %x5C ; \ reverse solidus U+005C / %x75.30.30.30 (%x30-37 / %x62 / %x65-66) ; u000X
/ %s"u000" (%x30-37 / %x62 / %x65-66) ; All ASCII control characters which do not have / %x75.30.30.31 (%x30-39 / %x61-66) ; u001X
; dedicated escape sequences (for example \n).
; u000X, where X is [0-7, b, e, f]
/ %s"u001" (%x30-39 / %x61-66) ; u001X, where X is [0-9, a-f]
```
#### Examples #### Examples

View file

@ -197,7 +197,7 @@ To ensure this is done consistently across clients, clients SHOULD use
the following algorithm to calculate a disambiguated display name for a the following algorithm to calculate a disambiguated display name for a
given user: given user:
1. Inspect the [`m.room.member`](#mroommember) state event for the relevant user id. 1. Inspect the `m.room.member` state event for the relevant user id.
2. If the `m.room.member` state event has no `displayname` field, or if 2. If the `m.room.member` state event has no `displayname` field, or if
that field has a `null` value, use the raw user id as the display that field has a `null` value, use the raw user id as the display
name. Otherwise: name. Otherwise:

View file

@ -22,8 +22,6 @@ properties:
description: |- description: |-
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_info: thumbnail_info:
allOf: allOf:
- $ref: thumbnail_info.yaml - $ref: thumbnail_info.yaml

View file

@ -23,8 +23,6 @@ properties:
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image.
Only present if the thumbnail is unencrypted. Only present if the thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in

View file

@ -16,8 +16,6 @@ properties:
The URL to the image. If this property is not present, the room has no avatar. This can be useful The URL to the image. If this property is not present, the room has no avatar. This can be useful
to remove a previous room avatar. to remove a previous room avatar.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
type: object type: object
state_key: state_key:
description: A zero-length string. description: A zero-length string.

View file

@ -54,8 +54,6 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the audio clip. to the audio clip.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -44,8 +44,6 @@ properties:
The URL to the thumbnail of the file. Only present if the The URL to the thumbnail of the file. Only present if the
thumbnail is unencrypted. thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in
@ -68,8 +66,6 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the file. to the file.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -44,8 +44,6 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the image. to the image.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -13,8 +13,6 @@ properties:
geo_uri: geo_uri:
description: A [geo URI (RFC5870)](https://datatracker.ietf.org/doc/html/rfc5870) representing this location. description: A [geo URI (RFC5870)](https://datatracker.ietf.org/doc/html/rfc5870) representing this location.
type: string type: string
format: uri
pattern: "^geo:"
msgtype: msgtype:
enum: enum:
- m.location - m.location
@ -27,8 +25,6 @@ properties:
The URL to a thumbnail of the location being represented. The URL to a thumbnail of the location being represented.
Only present if the thumbnail is unencrypted. Only present if the thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in

View file

@ -54,8 +54,6 @@ properties:
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to an image thumbnail of The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to an image thumbnail of
the video clip. Only present if the thumbnail is unencrypted. the video clip. Only present if the thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in
@ -78,8 +76,6 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the video clip. to the video clip.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -4,19 +4,16 @@ $schema: https://json-schema.org/draft/2020-12/schema
allOf: allOf:
- $ref: core-event-schema/state_event.yaml - $ref: core-event-schema/state_event.yaml
description: |- description: |-
A room has an opaque [room ID](/appendices#room-ids) which is not A room has an opaque room ID which is not human-friendly to read. A room
human-friendly to read. A [room alias](appendices#room-aliases) is alias is human-friendly, but not all rooms have room aliases. The room name
human-friendly, but not all rooms have [room aliases](/client-server-api/#room-aliases). is a human-friendly string designed to be displayed to the end-user. The
The room name is a human-friendly string designed to be displayed to the room name is not unique, as multiple rooms can have the same room name set.
end-user. The room name is not unique, as multiple rooms can have the same
room name set.
If a room has an `m.room.name` event with an absent, null, or empty `name` If a room has an `m.room.name` event with an absent, null, or empty `name`
field, it should be treated the same as a room with no `m.room.name` event. field, it should be treated the same as a room with no `m.room.name` event.
An event of this type is automatically created when creating a room using An event of this type is automatically created when creating a room using
[`/createRoom`](/client-server-api/#post_matrixclientv3createroom) with the `/createRoom` with the `name` key.
`name` key.
properties: properties:
content: content:
properties: properties:

View file

@ -11,8 +11,6 @@ properties:
description: An ordered list of event IDs to pin. description: An ordered list of event IDs to pin.
items: items:
type: string type: string
format: mx-event-id
pattern: "^\\$"
type: array type: array
required: required:
- pinned - pinned