make_leave returns an `event` field too

pull/1691/head
Richard van der Hoff 6 years ago
parent e17dd12007
commit 818b48cbbb

@ -60,7 +60,7 @@ paths:
x-example: ["1", "2"] x-example: ["1", "2"]
responses: responses:
200: 200:
description: description: |-
A template to be used for the rest of the `Joining Rooms`_ handshake. A template to be used for the rest of the `Joining Rooms`_ handshake.
schema: schema:
type: object type: object

@ -52,91 +52,98 @@ paths:
responses: responses:
200: 200:
description: |- description: |-
An unsigned event that the sending server may use as a template A template to be used to call ``/send_leave``.
for when it calls ``/send_leave``.
schema: schema:
allOf: schema:
- $ref: "definitions/unsigned_pdu.yaml" type: object
- type: object properties:
properties: event:
# Note: we override a bunch of parameters to change their descriptions allOf:
sender: - $ref: "definitions/unsigned_pdu.yaml"
type: string - description: |-
description: The user ID of the leaving member. An unsigned template event.
example: "@someone:example.org"
origin:
type: string
description: The name of the resident homeserver.
example: "matrix.org"
origin_server_ts:
type: integer
format: int64
description: A timestamp added by the resident homeserver.
example: 1234567890
type:
type: string
description: The value ``m.room.member``.
example: "m.room.member"
state_key:
type: string
description: The user ID of the leaving member.
example: "@someone:example.org"
content:
type: object type: object
title: Membership Event Content
description: The content of the event.
example: {"membership": "leave"}
properties: properties:
membership: # Note: we override a bunch of parameters to change their descriptions
sender:
type: string type: string
description: The value ``leave``. description: The user ID of the leaving member.
example: "leave" example: "@someone:example.org"
required: ['membership'] origin:
auth_events: type: string
type: array description: The name of the resident homeserver.
description: |- example: "matrix.org"
An event reference list containing the authorization events that would origin_server_ts:
allow the member to leave the room. This should normally be the type: integer
``m.room.create``, ``m.room.power_levels``, and ``m.room.join_rules`` format: int64
events. description: A timestamp added by the resident homeserver.
items: example: 1234567890
type: array type:
maxItems: 2 type: string
minItems: 2 description: The value ``m.room.member``.
items: example: "m.room.member"
- type: string state_key:
title: Event ID type: string
example: "$abc123:matrix.org" description: The user ID of the leaving member.
- type: object example: "@someone:example.org"
title: Event Hash content:
example: { type: object
"sha256": "abase64encodedsha256hashshouldbe43byteslong" title: Membership Event Content
} description: The content of the event.
properties: example: {"membership": "leave"}
sha256: properties:
type: string membership:
description: The event hash. type: string
example: abase64encodedsha256hashshouldbe43byteslong description: The value ``leave``.
required: ['sha256'] example: "leave"
redacts: required: ['membership']
type: string auth_events:
description: Not used. type: array
required: description: |-
# Every other field is already flagged as required by the $ref An event reference list containing the authorization events that would
- state_key allow the member to leave the room. This should normally be the
``m.room.create``, ``m.room.power_levels``, and ``m.room.join_rules``
events.
items:
type: array
maxItems: 2
minItems: 2
items:
- type: string
title: Event ID
example: "$abc123:matrix.org"
- type: object
title: Event Hash
example: {
"sha256": "abase64encodedsha256hashshouldbe43byteslong"
}
properties:
sha256:
type: string
description: The event hash.
example: abase64encodedsha256hashshouldbe43byteslong
required: ['sha256']
redacts:
type: string
description: Not used.
required:
# Every other field is already flagged as required by the $ref
- state_key
examples: examples:
application/json: { application/json: {
"$ref": "examples/unsigned_pdu.json", "event": {
"type": "m.room.member", "$ref": "examples/unsigned_pdu.json",
"state_key": "@someone:example.org", "type": "m.room.member",
"content": { "state_key": "@someone:example.org",
"content": {
"membership": "leave" "membership": "leave"
}, },
"auth_events": [ "auth_events": [
["$room_cre4te_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}], ["$room_cre4te_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}],
["$room_j0in_rul3s_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}], ["$room_j0in_rul3s_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}],
["$room_p0wer_l3vels_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}] ["$room_p0wer_l3vels_3vent:matrix.org", {"sha256": "abase64encodedsha256hashshouldbe43byteslong"}]
] ]
}
} }
403: 403:
description: |- description: |-

Loading…
Cancel
Save