diff --git a/api/client-server/v1/core b/api/client-server/v1/core new file mode 120000 index 00000000..9fc0cd87 --- /dev/null +++ b/api/client-server/v1/core @@ -0,0 +1 @@ +events/core \ No newline at end of file diff --git a/api/client-server/v1/definitions/event.yaml b/api/client-server/v1/definitions/event.yaml deleted file mode 100644 index cfb1b924..00000000 --- a/api/client-server/v1/definitions/event.yaml +++ /dev/null @@ -1,7 +0,0 @@ -type: object -description: A Matrix Event -properties: - event_id: - type: string - description: An event ID. -required: ["event_id"] \ No newline at end of file diff --git a/api/client-server/v1/definitions/room_event.yaml b/api/client-server/v1/definitions/room_event.yaml deleted file mode 100644 index 5a9e3a09..00000000 --- a/api/client-server/v1/definitions/room_event.yaml +++ /dev/null @@ -1,9 +0,0 @@ -type: object -description: A Matrix Room Event -properties: - event_id: - type: string - description: An event ID. - room_id: - type: string -required: ["event_id", "room_id"] \ No newline at end of file diff --git a/api/client-server/v1/definitions/state_event.yaml b/api/client-server/v1/definitions/state_event.yaml deleted file mode 100644 index f8e6f4d4..00000000 --- a/api/client-server/v1/definitions/state_event.yaml +++ /dev/null @@ -1,11 +0,0 @@ -type: object -description: A Matrix State Event -properties: - event_id: - type: string - description: An event ID. - room_id: - type: string - state_key: - type: string -required: ["event_id", "room_id", "state_key"] \ No newline at end of file diff --git a/api/client-server/v1/events b/api/client-server/v1/events new file mode 120000 index 00000000..7a0d0326 --- /dev/null +++ b/api/client-server/v1/events @@ -0,0 +1 @@ +../../../event-schemas/schema/v1 \ No newline at end of file diff --git a/api/client-server/v1/presence.yaml b/api/client-server/v1/presence.yaml index 6f8311e4..472a2d7f 100644 --- a/api/client-server/v1/presence.yaml +++ b/api/client-server/v1/presence.yaml @@ -205,4 +205,4 @@ paths: type: object title: PresenceEvent allOf: - - "$ref": "definitions/event.yaml" + - "$ref": "events/core/event.json" diff --git a/api/client-server/v1/sync.yaml b/api/client-server/v1/sync.yaml index 777e27db..b9525491 100644 --- a/api/client-server/v1/sync.yaml +++ b/api/client-server/v1/sync.yaml @@ -82,7 +82,7 @@ paths: type: object title: RoomEvent allOf: - - "$ref": "definitions/room_event.yaml" + - "$ref": "events/core/room_event.json" 400: description: "Bad pagination ``from`` parameter." "/initialSync": @@ -253,7 +253,7 @@ paths: type: object title: Event allOf: - - "$ref": "definitions/event.yaml" + - "$ref": "events/core/event.json" rooms: type: array items: @@ -294,7 +294,7 @@ paths: type: object title: RoomEvent allOf: - - "$ref": "definitions/room_event.yaml" + - "$ref": "events/core/room_event.json" required: ["start", "end", "chunk"] state: type: array @@ -307,7 +307,7 @@ paths: title: StateEvent type: object allOf: - - "$ref": "definitions/state_event.yaml" + - "$ref": "events/core/state_event.json" visibility: type: string enum: ["private", "public"] @@ -350,6 +350,6 @@ paths: } schema: allOf: - - "$ref": "definitions/event.yaml" + - "$ref": "events/core/event.json" 404: description: The event was not found or you do not have permission to read this event. diff --git a/event-schemas/schema/v1/core/.room_event.json.swp b/event-schemas/schema/v1/core/.room_event.json.swp new file mode 100644 index 00000000..fce0fd5f Binary files /dev/null and b/event-schemas/schema/v1/core/.room_event.json.swp differ diff --git a/event-schemas/schema/v1/core/event.json b/event-schemas/schema/v1/core/event.json index b4824079..e73aec80 100644 --- a/event-schemas/schema/v1/core/event.json +++ b/event-schemas/schema/v1/core/event.json @@ -1,17 +1,8 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "title": "Event", "description": "The basic set of fields all events must have.", "properties": { - "event_id": { - "type": "string", - "description": "The globally unique event identifier." - }, - "user_id": { - "type": "string", - "description": "Contains the fully-qualified ID of the user who *sent* this event." - }, "content": { "type": "object", "description": "The fields in this object will vary depending on the type of event. When interacting with the REST API, this is the HTTP body." diff --git a/event-schemas/schema/v1/core/room_event.json b/event-schemas/schema/v1/core/room_event.json index 717cdaae..a64ba2ea 100644 --- a/event-schemas/schema/v1/core/room_event.json +++ b/event-schemas/schema/v1/core/room_event.json @@ -1,5 +1,4 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "title": "Room Event", "description": "In addition to the Event fields, Room Events MUST have the following additional field.", @@ -10,7 +9,15 @@ "room_id": { "type": "string", "description": "The ID of the room associated with this event." - } + }, + "event_id": { + "type": "string", + "description": "The globally unique event identifier." + }, + "user_id": { + "type": "string", + "description": "Contains the fully-qualified ID of the user who *sent* this event." + }, }, "required": ["room_id"] } diff --git a/event-schemas/schema/v1/core/state_event.json b/event-schemas/schema/v1/core/state_event.json index a237f4d1..60de9413 100644 --- a/event-schemas/schema/v1/core/state_event.json +++ b/event-schemas/schema/v1/core/state_event.json @@ -1,20 +1,19 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "State Event", - "description": "In addition to the Room Event fields, State Events have the following additional fields.", - "allOf":[{ - "$ref": "core/room_event.json" - }], - "properties": { - "state_key": { - "type": "string", - "description": "A unique key which defines the overwriting semantics for this piece of room state. This value is often a zero-length string. The presence of this key makes this event a State Event." - }, - "prev_content": { - "type": "object", - "description": "Optional. The previous ``content`` for this event. If there is no previous content, this key will be missing." - } - }, - "required": ["state_key"] + "type": "object", + "title": "State Event", + "description": "In addition to the Room Event fields, State Events have the following additional fields.", + "allOf":[{ + "$ref": "core/room_event.json" + }], + "properties": { + "state_key": { + "type": "string", + "description": "A unique key which defines the overwriting semantics for this piece of room state. This value is often a zero-length string. The presence of this key makes this event a State Event." + }, + "prev_content": { + "type": "object", + "description": "Optional. The previous ``content`` for this event. If there is no previous content, this key will be missing." + } + }, + "required": ["state_key"] }