From d5b09604b33a3a7eec03d9107bb6054d61268d2c Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 3 Jan 2023 18:07:06 +0000 Subject: [PATCH] Separate response schemas for v2/send_join and v1/send_join we are extending v2, but not v1. --- .../definitions/send_join_response.yaml | 68 ------------------- data/api/server-server/joins-v1.yaml | 41 ++++++++++- data/api/server-server/joins-v2.yaml | 47 ++++++++++++- 3 files changed, 86 insertions(+), 70 deletions(-) delete mode 100644 data/api/server-server/definitions/send_join_response.yaml diff --git a/data/api/server-server/definitions/send_join_response.yaml b/data/api/server-server/definitions/send_join_response.yaml deleted file mode 100644 index 12b020a2..00000000 --- a/data/api/server-server/definitions/send_join_response.yaml +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 2018 New Vector Ltd -# Copyright 2020 The Matrix.org Foundation C.I.C. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -type: object -title: Room State -description: The state for the room. -properties: - origin: - type: string - description: The resident server's DNS name. - auth_chain: - type: array - description: |- - The auth chain for the entire current room state prior to the join event. - - Note that events have a different format depending on the room version - check the - [room version specification](/rooms) for precise event formats. - items: - type: object - title: PDU - description: |- - The [PDUs](/server-server-api/#pdus) that make up the auth chain. The event format varies depending - on the room version - check the [room version specification](/rooms) for precise event formats. - schema: - type: object - properties: {} - example: - $ref: "../examples/minimal_pdu.json" - state: - type: array - description: |- - The resolved current room state prior to the join event. - - The event format varies depending on the room version - check the [room version specification](/rooms) - for precise event formats. - items: - type: object - title: PDU - description: |- - The [PDUs](/server-server-api/#pdus) for the fully resolved state of the room. The event format varies depending - on the room version - check the [room version specification](/rooms) for precise event formats. - schema: - type: object - properties: {} - example: - $ref: "../examples/minimal_pdu.json" - event: - type: object - title: SignedMembershipEvent - x-addedInMatrixVersion: "1.2" - description: |- - Required if the room version [supports restricted join rules](/rooms/#feature-matrix). The signed - copy of the membership event sent to other servers by the resident server, including the resident - server's signature. - example: - $ref: "../examples/minimal_pdu.json" -required: ["auth_chain", "state", "origin"] diff --git a/data/api/server-server/joins-v1.yaml b/data/api/server-server/joins-v1.yaml index b45a49e2..1b850266 100644 --- a/data/api/server-server/joins-v1.yaml +++ b/data/api/server-server/joins-v1.yaml @@ -333,7 +333,46 @@ paths: - type: integer description: The value `200`. example: 200 - - $ref: "./definitions/send_join_response.yaml" + - type: object + title: Room State + description: The state for the room. + properties: + origin: + type: string + description: The resident server's DNS name. + auth_chain: + type: array + description: |- + The auth chain for the entire current room state prior to the join event. + + Note that events have a different format depending on the room version - check the + [room version specification](/rooms) for precise event formats. + items: + type: object + title: PDU + description: |- + The [PDUs](/server-server-api/#pdus) that make up the auth chain. The event format varies depending + on the room version - check the [room version specification](/rooms) for precise event formats. + schema: + type: object + properties: {} + state: + type: array + description: |- + The resolved current room state prior to the join event. + + The event format varies depending on the room version - check the [room version specification](/rooms) + for precise event formats. + items: + type: object + title: PDU + description: |- + The [PDUs](/server-server-api/#pdus) for the fully resolved state of the room. The event format varies depending + on the room version - check the [room version specification](/rooms) for precise event formats. + schema: + type: object + properties: {} + required: ["auth_chain", "state", "origin"] examples: application/json: [ 200, diff --git a/data/api/server-server/joins-v2.yaml b/data/api/server-server/joins-v2.yaml index 78560c86..9ce7beec 100644 --- a/data/api/server-server/joins-v2.yaml +++ b/data/api/server-server/joins-v2.yaml @@ -186,7 +186,52 @@ paths: description: |- The join event has been accepted into the room. schema: - $ref: "./definitions/send_join_response.yaml" + type: object + properties: + origin: + type: string + description: The resident server's DNS name. + auth_chain: + type: array + description: |- + The auth chain for the entire current room state prior to the join event. + + Note that events have a different format depending on the room version - check the + [room version specification](/rooms) for precise event formats. + items: + type: object + title: PDU + description: |- + The [PDUs](/server-server-api/#pdus) that make up the auth chain. The event format varies depending + on the room version - check the [room version specification](/rooms) for precise event formats. + schema: + type: object + properties: {} + state: + type: array + description: |- + The resolved current room state prior to the join event. + + The event format varies depending on the room version - check the [room version specification](/rooms) + for precise event formats. + items: + type: object + title: PDU + description: |- + The [PDUs](/server-server-api/#pdus) for the fully resolved state of the room. The event format varies depending + on the room version - check the [room version specification](/rooms) for precise event formats. + schema: + type: object + properties: {} + event: + type: object + title: SignedMembershipEvent + x-addedInMatrixVersion: "1.2" + description: |- + Required if the room version [supports restricted join rules](/rooms/#feature-matrix). The signed + copy of the membership event sent to other servers by the resident server, including the resident + server's signature. + required: ["auth_chain", "state", "origin"] examples: application/json: { "origin": "matrix.org",