Skip to content

Commit 979264e

Browse files
authored
Fix example for ExportedSessionData (#2154)
Currently, the example for `ExportedSessionData` is missing values for `room_id` and `session_id`. Move the example field values for `KeyBackupSessionData` into the field definitions, so that an example for the object as a whole is built automatically, and when we extend it to form `ExportedSessionData` the explicit example does not override the more complete autogenerated one.
1 parent 51ccbbd commit 979264e

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add missing fields in example for `ExportedSessionData`.

data/api/client-server/definitions/key_backup_session_data.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,32 @@ properties:
2323
type: string
2424
description: |-
2525
The end-to-end message encryption algorithm that the key is for. Must be `m.megolm.v1.aes-sha2`.
26+
example: "m.megolm.v1.aes-sha2"
2627
forwarding_curve25519_key_chain:
2728
type: array
2829
items:
2930
type: string
3031
description: |-
3132
Chain of Curve25519 keys through which this session was forwarded, via [m.forwarded_room_key](/client-server-api/#mforwarded_room_key)
3233
events.
34+
example: [ "hPQNcabIABgGnx3/ACv/jmMmiQHoeFfuLB17tzWp6Hw" ]
3335
sender_key:
3436
type: string
3537
description: |-
3638
Unpadded base64-encoded device Curve25519 key.
39+
example: "RF3s+E7RkTQTGF2d8Deol0FkQvgII2aJDf3/Jp5mxVU"
3740
sender_claimed_keys:
3841
type: object
3942
additionalProperties:
4043
type: string
4144
description: |-
4245
A map from algorithm name (`ed25519`) to the Ed25519 signing key of the sending device.
46+
example: { "ed25519": "aj40p+aw64yPIdsxoog8jhPu9i7l7NcFRecuOQblE3Y" }
4347
session_key:
4448
type: string
4549
description: |-
4650
Unpadded base64-encoded session key in [session-export format](https://gitlab.matrix.org/matrix-org/olm/blob/master/docs/megolm.md#session-export-format).
47-
example: {
48-
"algorithm": "m.megolm.v1.aes-sha2",
49-
"forwarding_curve25519_key_chain": [
50-
"hPQNcabIABgGnx3/ACv/jmMmiQHoeFfuLB17tzWp6Hw"
51-
],
52-
"sender_key": "RF3s+E7RkTQTGF2d8Deol0FkQvgII2aJDf3/Jp5mxVU",
53-
"sender_claimed_keys": {
54-
"ed25519": "aj40p+aw64yPIdsxoog8jhPu9i7l7NcFRecuOQblE3Y",
55-
},
56-
"session_key": "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8Llf..."
57-
}
51+
example: "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8Llf..."
5852
required:
5953
- algorithm
6054
- forwarding_curve25519_key_chain

0 commit comments

Comments
 (0)