Fix the rendering of the event format for room versions 1 and 2 (#1883)

* Fix rendering of array with items using anyOf

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Use a single definition for Event Hash

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add ending newline

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-06-20 17:39:44 +02:00 committed by GitHub
parent 094e25b6cd
commit bd20d946c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 33 additions and 63 deletions

View file

@ -0,0 +1,13 @@
type: object
title: Event Hash
description: |-
Content hashes of the PDU, following the algorithm specified in [Signing Events](/server-server-api/#signing-events).
example: {
"sha256": "ThisHashCoversAllFieldsInCaseThisIsRedacted"
}
properties:
sha256:
type: string
description: The hash.
example: ThisHashCoversAllFieldsInCaseThisIsRedacted
required: ['sha256']

View file

@ -25,19 +25,7 @@ allOf:
description: For redaction events, the ID of the event being redacted.
example: "$def456:matrix.org"
hashes:
type: object
title: Event Hash
description: |-
Content hashes of the PDU, following the algorithm specified in [Signing Events](/server-server-api/#signing-events).
example: {
"sha256": "ThisHashCoversAllFieldsInCaseThisIsRedacted"
}
properties:
sha256:
type: string
description: The hash.
example: ThisHashCoversAllFieldsInCaseThisIsRedacted
required: ['sha256']
$ref: "event_hash.yaml"
signatures:
type: object
description: |-

View file

@ -47,19 +47,7 @@ allOf:
Must contain less than or equal to 20 events.
example: ["$URLsafe-base64EncodedHash", "$Another_Event"]
hashes:
type: object
title: Event Hash
description: |-
Content hashes of the PDU, following the algorithm specified in [Signing Events](/server-server-api/#signing-events).
example: {
"sha256": "ThisHashCoversAllFieldsInCaseThisIsRedacted"
}
properties:
sha256:
type: string
description: The hash.
example: ThisHashCoversAllFieldsInCaseThisIsRedacted
required: ['sha256']
$ref: "event_hash.yaml"
signatures:
type: object
description: |-

View file

@ -49,19 +49,7 @@ allOf:
Must contain less than or equal to 20 events.
example: ["$base64EncodedHash", "$AnotherEvent"]
hashes:
type: object
title: Event Hash
description: |-
Content hashes of the PDU, following the algorithm specified in [Signing Events](/server-server-api/#signing-events).
example: {
"sha256": "ThisHashCoversAllFieldsInCaseThisIsRedacted"
}
properties:
sha256:
type: string
description: The hash.
example: ThisHashCoversAllFieldsInCaseThisIsRedacted
required: ['sha256']
$ref: "event_hash.yaml"
signatures:
type: object
description: |-

View file

@ -60,17 +60,7 @@ properties:
- type: string
title: Event ID
example: "$abc123:matrix.org"
- type: object
title: Event Hash
example: {
"sha256": "Base64EncodedSha256HashesShouldBe43BytesLong"
}
properties:
sha256:
type: string
description: The event hash.
example: Base64EncodedSha256HashesShouldBe43BytesLong
required: ['sha256']
- $ref: "event_hash.yaml"
depth:
type: integer
description: |-
@ -96,17 +86,7 @@ properties:
- type: string
title: Event ID
example: "$abc123:matrix.org"
- type: object
title: Event Hash
example: {
"sha256": "Base64EncodedSha256HashesShouldBe43BytesLong"
}
properties:
sha256:
type: string
description: The event hash.
example: Base64EncodedSha256HashesShouldBe43BytesLong
required: ['sha256']
- $ref: "event_hash.yaml"
unsigned:
type: object
title: UnsignedData