From 4f606cf3a7098359f68bd292dab43450d7081602 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 6 Oct 2015 17:31:05 +0100 Subject: [PATCH 1/3] Add the fields required by the templating system to v2 sync --- api/client-server/v2_alpha/sync.yaml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/api/client-server/v2_alpha/sync.yaml b/api/client-server/v2_alpha/sync.yaml index 7d60d639..266f27bc 100644 --- a/api/client-server/v2_alpha/sync.yaml +++ b/api/client-server/v2_alpha/sync.yaml @@ -72,36 +72,49 @@ paths: The batch token to supply in the ``since`` param of the next ``/sync`` request. rooms: + title: Rooms type: object description: |- Updates to rooms. properties: joined: + title: Joined type: object additionalProperties: + title: Joined Room type: object properties: event_map: + title: EventMap type: object description: |- A map from event ID to events for this room. The events are referenced from the ``timeline`` and ``state`` keys for this room. additionalProperties: + title: Event description: An event object. type: object + allOf: + - $ref: "core-event-schema/event.json" state: + title: State + type: object description: |- The state updates for the room. allOf: - $ref: "definitions/room_event_batch.json" timeline: + title: Timeline + type: object description: |- The timeline of messages and state changes in the room. allOf: - $ref: "definitions/timeline_batch.json" ephemeral: + title: Ephemeral + type: object description: |- The ephemeral events in the room that aren't recorded in the timeline or state of the room. @@ -109,13 +122,17 @@ paths: allOf: - $ref: "definitions/event_batch.json" invited: + title: Invited type: object description: |- The rooms that the user has been invited to. additionalProperties: + title: Invited Room type: object properties: invite_state: + title: InviteState + type: object description: |- The state of a room that the user has been invited to. These state events may only have the `sender``, @@ -132,35 +149,47 @@ paths: allOf: - $ref: "definitions/event_batch.json" archived: + title: Archived type: object description: |- The rooms that the user has left or been banned from. The entries in the room_map will lack an ``ephemeral`` key. additionalProperties: + title: Archived Room type: object properties: event_map: + title: EventMap type: object description: |- A map from event ID to events for this room. The events are referenced from the ``timeline`` and ``state`` keys for this room. additionalProperties: + title: Event description: An event object. type: object + allOf: + - $ref: "core-event-schema/event.json" state: + title: State + type: object description: |- The state updates for the room up to the point when the user left. allOf: - $ref: "definitions/room_event_batch.json" timeline: + title: Timeline + type: object description: |- The timeline of messages and state changes in the room up to the point when the user left. allOf: - $ref: "definitions/timeline_batch.json" presence: + title: Presence + type: object description: |- The updates to the presence status of other users. allOf: From 509d178d5892f8ed218b5919fcc36a77cb14109a Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 6 Oct 2015 17:40:28 +0100 Subject: [PATCH 2/3] Fix the receipts API to be valid swagger --- api/client-server/v2_alpha/definitions/error.yaml | 10 ++++++++++ api/client-server/v2_alpha/receipts.yaml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 api/client-server/v2_alpha/definitions/error.yaml diff --git a/api/client-server/v2_alpha/definitions/error.yaml b/api/client-server/v2_alpha/definitions/error.yaml new file mode 100644 index 00000000..20312ae4 --- /dev/null +++ b/api/client-server/v2_alpha/definitions/error.yaml @@ -0,0 +1,10 @@ +type: object +description: A Matrix-level Error +properties: + errcode: + type: string + description: An error code. + error: + type: string + description: A human-readable error message. +required: ["errcode"] \ No newline at end of file diff --git a/api/client-server/v2_alpha/receipts.yaml b/api/client-server/v2_alpha/receipts.yaml index 4ef435b0..b60f72e6 100644 --- a/api/client-server/v2_alpha/receipts.yaml +++ b/api/client-server/v2_alpha/receipts.yaml @@ -47,6 +47,7 @@ paths: required: true x-example: "$1924376522eioj:example.com" - in: body + name: receipt description: |- Extra receipt information to attach to ``content`` if any. The server will automatically set the ``ts`` field. @@ -65,4 +66,4 @@ paths: 429: description: This request was rate-limited. schema: - "$ref": "definitions/error.yaml" \ No newline at end of file + "$ref": "definitions/error.yaml" From 034241eb20cb0958bccb78f939c21d036c95d63f Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 6 Oct 2015 17:43:04 +0100 Subject: [PATCH 3/3] Missing symlink for the v2 swagger APIs --- api/client-server/v2_alpha/core-event-schema | 1 + 1 file changed, 1 insertion(+) create mode 120000 api/client-server/v2_alpha/core-event-schema diff --git a/api/client-server/v2_alpha/core-event-schema b/api/client-server/v2_alpha/core-event-schema new file mode 120000 index 00000000..b020e6da --- /dev/null +++ b/api/client-server/v2_alpha/core-event-schema @@ -0,0 +1 @@ +../../../event-schemas/schema/v1/core-event-schema \ No newline at end of file