mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-22 18:54:09 +02:00
Use correct schema and examples; Remind readers often about formats
This commit is contained in:
parent
1692d22a8c
commit
8ce59031c4
9
data/api/server-server/examples/stripped_state.json
Normal file
9
data/api/server-server/examples/stripped_state.json
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
[
|
||||||
|
{"$ref": "./minimal_pdu.json"},
|
||||||
|
{
|
||||||
|
"type": "m.room.create",
|
||||||
|
"content": {
|
||||||
|
"see_room_version_spec": "The event format changes depending on the room version."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -85,10 +85,19 @@ paths:
|
||||||
Servers might need to apply validation to the `invite_room_state` depending
|
Servers might need to apply validation to the `invite_room_state` depending
|
||||||
on room version. See the `400 M_MISSING_PARAM` error definition for more
|
on room version. See the `400 M_MISSING_PARAM` error definition for more
|
||||||
information.
|
information.
|
||||||
|
|
||||||
|
Note that events have a different format depending on the room
|
||||||
|
version - check the [room version specification](/rooms) for
|
||||||
|
precise event formats.
|
||||||
items:
|
items:
|
||||||
$ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml
|
type: object
|
||||||
|
properties: {}
|
||||||
|
description: |-
|
||||||
|
Note that events have a different format depending on the room
|
||||||
|
version - check the [room version specification](/rooms) for
|
||||||
|
precise event formats.
|
||||||
example:
|
example:
|
||||||
$ref: ../../event-schemas/examples/invite_room_state.json
|
$ref: ./examples/stripped_state.json
|
||||||
type: object
|
type: object
|
||||||
required: true
|
required: true
|
||||||
responses:
|
responses:
|
||||||
|
|
@ -129,35 +138,7 @@ paths:
|
||||||
"origin_server_ts": 1549041175876,
|
"origin_server_ts": 1549041175876,
|
||||||
"sender": "@someone:example.org",
|
"sender": "@someone:example.org",
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
"invite_room_state": [
|
"invite_room_state": {"$ref": "./examples/stripped_state.json"}
|
||||||
{
|
|
||||||
"type": "m.room.create",
|
|
||||||
"sender": "@bob:example.org",
|
|
||||||
"state_key": "",
|
|
||||||
"content": {
|
|
||||||
"version": "12"
|
|
||||||
},
|
|
||||||
"remaining_fields": "are formatted according to the room version specification"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "m.room.name",
|
|
||||||
"sender": "@bob:example.org",
|
|
||||||
"state_key": "",
|
|
||||||
"content": {
|
|
||||||
"name": "Example Room"
|
|
||||||
},
|
|
||||||
"remaining_fields": "are formatted according to the room version specification"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "m.room.join_rules",
|
|
||||||
"sender": "@bob:example.org",
|
|
||||||
"state_key": "",
|
|
||||||
"content": {
|
|
||||||
"join_rule": "invite"
|
|
||||||
},
|
|
||||||
"remaining_fields": "are formatted according to the room version specification"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"content": {
|
"content": {
|
||||||
"membership": "invite"
|
"membership": "invite"
|
||||||
|
|
|
||||||
|
|
@ -86,10 +86,19 @@ paths:
|
||||||
Servers might need to apply validation to the `invite_room_state` depending
|
Servers might need to apply validation to the `invite_room_state` depending
|
||||||
on room version. See the `400 M_MISSING_PARAM` error definition for more
|
on room version. See the `400 M_MISSING_PARAM` error definition for more
|
||||||
information.
|
information.
|
||||||
|
|
||||||
|
Note that events have a different format depending on the room
|
||||||
|
version - check the [room version specification](/rooms) for
|
||||||
|
precise event formats.
|
||||||
items:
|
items:
|
||||||
$ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml
|
type: object
|
||||||
|
properties: {}
|
||||||
|
description: |-
|
||||||
|
Note that events have a different format depending on the room
|
||||||
|
version - check the [room version specification](/rooms) for
|
||||||
|
precise event formats.
|
||||||
example:
|
example:
|
||||||
$ref: ../../event-schemas/examples/invite_room_state.json
|
$ref: ./examples/stripped_state.json
|
||||||
required:
|
required:
|
||||||
- room_version
|
- room_version
|
||||||
- event
|
- event
|
||||||
|
|
@ -122,35 +131,7 @@ paths:
|
||||||
"origin_server_ts": 1549041175876,
|
"origin_server_ts": 1549041175876,
|
||||||
"sender": "@someone:example.org",
|
"sender": "@someone:example.org",
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
"invite_room_state": [
|
"invite_room_state": {"$ref": "./examples/stripped_state.json"}
|
||||||
{
|
|
||||||
"type": "m.room.create",
|
|
||||||
"sender": "@bob:example.org",
|
|
||||||
"state_key": "",
|
|
||||||
"content": {
|
|
||||||
"version": "12"
|
|
||||||
},
|
|
||||||
"remaining_fields": "are formatted according to the room version specification"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "m.room.name",
|
|
||||||
"sender": "@bob:example.org",
|
|
||||||
"state_key": "",
|
|
||||||
"content": {
|
|
||||||
"name": "Example Room"
|
|
||||||
},
|
|
||||||
"remaining_fields": "are formatted according to the room version specification"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "m.room.join_rules",
|
|
||||||
"sender": "@bob:example.org",
|
|
||||||
"state_key": "",
|
|
||||||
"content": {
|
|
||||||
"join_rule": "invite"
|
|
||||||
},
|
|
||||||
"remaining_fields": "are formatted according to the room version specification"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"content": {
|
"content": {
|
||||||
"membership": "invite"
|
"membership": "invite"
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,12 @@ paths:
|
||||||
knock_room_state:
|
knock_room_state:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml
|
type: object
|
||||||
|
properties: {}
|
||||||
|
description: |-
|
||||||
|
Note that events have a different format depending on the room
|
||||||
|
version - check the [room version specification](/rooms) for
|
||||||
|
precise event formats.
|
||||||
x-changedInMatrixVersion:
|
x-changedInMatrixVersion:
|
||||||
"1.16": |
|
"1.16": |
|
||||||
`m.room.create` and format requirements were added.
|
`m.room.create` and format requirements were added.
|
||||||
|
|
@ -309,15 +314,19 @@ paths:
|
||||||
Entries which are [improperly signed](/server-server-api/#validating-hashes-and-signatures-on-received-events)
|
Entries which are [improperly signed](/server-server-api/#validating-hashes-and-signatures-on-received-events)
|
||||||
or formatted SHOULD be removed by the server prior to supplying
|
or formatted SHOULD be removed by the server prior to supplying
|
||||||
them over the Client-Server API.
|
them over the Client-Server API.
|
||||||
|
|
||||||
|
Note that events have a different format depending on the room
|
||||||
|
version - check the [room version specification](/rooms) for
|
||||||
|
precise event formats.
|
||||||
example:
|
example:
|
||||||
$ref: ../../event-schemas/examples/knock_room_state.json
|
"$ref": "./examples/stripped_state.json"
|
||||||
required:
|
required:
|
||||||
- knock_room_state
|
- knock_room_state
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value: {
|
||||||
"knock_room_state": {
|
"knock_room_state": {
|
||||||
"$ref": "../../event-schemas/examples/knock_room_state.json"
|
"$ref": "./examples/stripped_state.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"403":
|
"403":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue