From 5383754a40158a3a0ab655a166343674328c41b7 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 4 May 2016 14:28:11 +0100 Subject: [PATCH] Access event-schemas via a symlink Swagger gets a bit confused about $refs via '../..', so use a symlink to make everything nicely relative. --- api/client-server/definitions/event-schemas | 1 + api/client-server/event_context.yaml | 8 ++++---- api/client-server/old_sync.yaml | 14 +++++++------- api/client-server/peeking_events.yaml | 2 +- api/client-server/presence.yaml | 2 +- api/client-server/rooms.yaml | 10 +++++----- api/client-server/search.yaml | 8 ++++---- 7 files changed, 23 insertions(+), 22 deletions(-) create mode 120000 api/client-server/definitions/event-schemas diff --git a/api/client-server/definitions/event-schemas b/api/client-server/definitions/event-schemas new file mode 120000 index 00000000..376cf90c --- /dev/null +++ b/api/client-server/definitions/event-schemas @@ -0,0 +1 @@ +../../../event-schemas \ No newline at end of file diff --git a/api/client-server/event_context.yaml b/api/client-server/event_context.yaml index 5492591b..e2d148cb 100644 --- a/api/client-server/event_context.yaml +++ b/api/client-server/event_context.yaml @@ -64,12 +64,12 @@ paths: requested event, in reverse-chronological order. items: allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" event: description: |- Details of the requested event. allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" events_after: type: array description: |- @@ -77,14 +77,14 @@ paths: requested event, in chronological order. items: allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" state: type: array description: |- The state of the room at the last event returned. items: allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/state_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/state_event.yaml" examples: application/json: |- { diff --git a/api/client-server/old_sync.yaml b/api/client-server/old_sync.yaml index 0df8809a..b689b775 100644 --- a/api/client-server/old_sync.yaml +++ b/api/client-server/old_sync.yaml @@ -80,7 +80,7 @@ paths: type: object title: Event allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" 400: description: "Bad pagination ``from`` parameter." tags: @@ -283,7 +283,7 @@ paths: type: object title: Event allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" rooms: type: array items: @@ -302,7 +302,7 @@ paths: title: "InviteEvent" description: "The invite event if ``membership`` is ``invite``" allOf: - - "$ref": "../../event-schemas/schema/m.room.member" + - "$ref": "definitions/event-schemas/schema/m.room.member" messages: type: object title: PaginationChunk @@ -330,7 +330,7 @@ paths: type: object title: RoomEvent allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" required: ["start", "end", "chunk"] state: type: array @@ -343,7 +343,7 @@ paths: title: StateEvent type: object allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/state_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/state_event.yaml" visibility: type: string enum: ["private", "public"] @@ -359,7 +359,7 @@ paths: title: Event type: object allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" required: ["room_id", "membership"] required: ["end", "rooms", "presence"] 404: @@ -399,7 +399,7 @@ paths: } schema: allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" 404: description: The event was not found or you do not have permission to read this event. tags: diff --git a/api/client-server/peeking_events.yaml b/api/client-server/peeking_events.yaml index 60168f6f..fb1d7042 100644 --- a/api/client-server/peeking_events.yaml +++ b/api/client-server/peeking_events.yaml @@ -95,7 +95,7 @@ paths: type: object title: Event allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" 400: description: "Bad pagination ``from`` parameter." # No tags to exclude this from the swagger UI - use the normal version instead. diff --git a/api/client-server/presence.yaml b/api/client-server/presence.yaml index a21b5a19..bb7d1cda 100644 --- a/api/client-server/presence.yaml +++ b/api/client-server/presence.yaml @@ -206,6 +206,6 @@ paths: type: object title: PresenceEvent allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" tags: - Presence diff --git a/api/client-server/rooms.yaml b/api/client-server/rooms.yaml index 12881604..6b9f28f2 100644 --- a/api/client-server/rooms.yaml +++ b/api/client-server/rooms.yaml @@ -210,7 +210,7 @@ paths: title: StateEvent type: object allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/state_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/state_event.yaml" 403: description: > You aren't a member of the room and weren't previously a @@ -392,7 +392,7 @@ paths: type: object title: RoomEvent allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" required: ["start", "end", "chunk"] state: type: array @@ -405,7 +405,7 @@ paths: title: StateEvent type: object allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/state_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/state_event.yaml" visibility: type: string enum: ["private", "public"] @@ -420,7 +420,7 @@ paths: title: Event type: object allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/event.yaml" required: ["room_id"] 403: description: > @@ -491,7 +491,7 @@ paths: title: MemberEvent type: object allOf: - - "$ref": "../../event-schemas/schema/m.room.member" + - "$ref": "definitions/event-schemas/schema/m.room.member" 403: description: > You aren't a member of the room and weren't previously a diff --git a/api/client-server/search.yaml b/api/client-server/search.yaml index 828154bc..97a6d8c6 100644 --- a/api/client-server/search.yaml +++ b/api/client-server/search.yaml @@ -180,7 +180,7 @@ paths: title: Event description: The event that matched. allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" context: type: object title: Event Context @@ -220,7 +220,7 @@ paths: type: object title: Event allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" events_after: type: array title: Events After @@ -229,7 +229,7 @@ paths: type: object title: Event allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" state: type: object title: Current state @@ -244,7 +244,7 @@ paths: type: object title: Event allOf: - - "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml" + - "$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml" groups: type: object title: Groups