make_join returns its event under an `event` key

pull/977/head
Richard van der Hoff 6 years ago
parent 16bbf46b2e
commit e17dd12007

@ -60,96 +60,102 @@ paths:
x-example: ["1", "2"] x-example: ["1", "2"]
responses: responses:
200: 200:
description: |- description:
An unsigned event that the server may now use as a template A template to be used for the rest of the `Joining Rooms`_ handshake.
for the rest of the `Joining Rooms`_ handshake.
schema: schema:
allOf: type: object
- $ref: "definitions/unsigned_pdu.yaml" properties:
- type: object event:
properties: allOf:
# Note: we override a bunch of parameters to change their descriptions - $ref: "definitions/unsigned_pdu.yaml"
sender: - description: |-
type: string An unsigned template event.
description: The user ID of the joining member.
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 joining member.
example: "@someone:example.org"
content:
type: object type: object
title: Membership Event Content
description: The content of the event.
example: {"membership": "join"}
properties: properties:
membership: # Note: we override a bunch of parameters to change their descriptions
sender:
type: string type: string
description: The value ``join``. description: The user ID of the joining member.
example: "join" example: "@someone:example.org"
required: ['membership'] origin:
depth: type: string
type: integer description: The name of the resident homeserver.
description: This field must be present but is ignored; it may be 0. example: "matrix.org"
example: 12 origin_server_ts:
auth_events: type: integer
type: array format: int64
description: |- description: A timestamp added by the resident homeserver.
An event reference list containing the authorization events that would example: 1234567890
allow the member to join the room. This should normally be the type:
``m.room.create``, ``m.room.power_levels``, and ``m.room.join_rules`` type: string
events. description: The value ``m.room.member``.
items: example: "m.room.member"
type: array state_key:
maxItems: 2 type: string
minItems: 2 description: The user ID of the joining member.
items: example: "@someone:example.org"
- type: string content:
title: Event ID type: object
example: "$abc123:matrix.org" title: Membership Event Content
- type: object description: The content of the event.
title: Event Hash example: {"membership": "join"}
example: { properties:
"sha256": "abase64encodedsha256hashshouldbe43byteslong" membership:
} type: string
properties: description: The value ``join``.
sha256: example: "join"
type: string required: ['membership']
description: The event hash. depth:
example: abase64encodedsha256hashshouldbe43byteslong type: integer
required: ['sha256'] description: This field must be present but is ignored; it may be 0.
redacts: example: 12
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 join 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": "join" "membership": "join"
}, },
"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"}]
] ]
}
} }
400: 400:
description: |- description: |-

Loading…
Cancel
Save