diff --git a/event-schemas/README.md b/event-schemas/README.md new file mode 100644 index 00000000..1030a04c --- /dev/null +++ b/event-schemas/README.md @@ -0,0 +1,13 @@ +Testing a schema +---------------- +There are [many](http://json-schema.org/implementations.html) JSON Schema +validators you can use to validate incoming events. Not all of them support +JSON Schema v4, and some of them have bugs which prevent ``$ref`` from being +resolved correctly. For basic CLI testing, we recommend and have verified they +work with the Node.js package [z-schema](https://github.com/zaggino/z-schema): +``` + $ npm install -g z-schema + $ z-schema schema/v1/m.room.message examples/v1/m.room.message_m.text + schema validation passed + json #1 validation passed +``` diff --git a/event-schemas/examples/v1/m.call.answer b/event-schemas/examples/v1/m.call.answer new file mode 100644 index 00000000..0301fb3b --- /dev/null +++ b/event-schemas/examples/v1/m.call.answer @@ -0,0 +1,17 @@ +{ + "age": 242352, + "content": { + "version" : 0, + "call_id": "12345", + "lifetime": 60000, + "answer": { + "type" : "answer", + "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" + } + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.call.answer", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.call.candidates b/event-schemas/examples/v1/m.call.candidates new file mode 100644 index 00000000..389d2271 --- /dev/null +++ b/event-schemas/examples/v1/m.call.candidates @@ -0,0 +1,19 @@ +{ + "age": 242352, + "content": { + "version" : 0, + "call_id": "12345", + "candidates": [ + { + "sdpMid": "audio", + "sdpMLineIndex": 0, + "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0" + } + ] + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.call.candidates", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.call.hangup b/event-schemas/examples/v1/m.call.hangup new file mode 100644 index 00000000..52ddad16 --- /dev/null +++ b/event-schemas/examples/v1/m.call.hangup @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "version" : 0, + "call_id": "12345" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.call.hangup", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.call.invite b/event-schemas/examples/v1/m.call.invite new file mode 100644 index 00000000..2df25929 --- /dev/null +++ b/event-schemas/examples/v1/m.call.invite @@ -0,0 +1,17 @@ +{ + "age": 242352, + "content": { + "version" : 0, + "call_id": "12345", + "lifetime": 60000, + "offer": { + "type" : "offer", + "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" + } + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.call.invite", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.presence b/event-schemas/examples/v1/m.presence new file mode 100644 index 00000000..695bd99b --- /dev/null +++ b/event-schemas/examples/v1/m.presence @@ -0,0 +1,10 @@ +{ + "content": { + "avatar_url": "mxc://localhost:wefuiwegh8742w", + "last_active_ago": 2478593, + "presence": "online", + "user_id": "@example:localhost" + }, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.presence" +} diff --git a/event-schemas/examples/v1/m.room.aliases b/event-schemas/examples/v1/m.room.aliases new file mode 100644 index 00000000..07b4b330 --- /dev/null +++ b/event-schemas/examples/v1/m.room.aliases @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "aliases": ["#somewhere:localhost", "#another:localhost"] + }, + "state_key": "localhost", + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.aliases", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.create b/event-schemas/examples/v1/m.room.create new file mode 100644 index 00000000..a3598853 --- /dev/null +++ b/event-schemas/examples/v1/m.room.create @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "creator": "@example:localhost" + }, + "state_key": "", + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.create", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.join_rules b/event-schemas/examples/v1/m.room.join_rules new file mode 100644 index 00000000..f22ad97e --- /dev/null +++ b/event-schemas/examples/v1/m.room.join_rules @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "join_rule": "public" + }, + "state_key": "", + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.join_rules", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.member b/event-schemas/examples/v1/m.room.member new file mode 100644 index 00000000..abfd89ce --- /dev/null +++ b/event-schemas/examples/v1/m.room.member @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "membership": "join" + }, + "state_key": "@alice:localhost", + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.member", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.message.feedback b/event-schemas/examples/v1/m.room.message.feedback new file mode 100644 index 00000000..6282305b --- /dev/null +++ b/event-schemas/examples/v1/m.room.message.feedback @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "type": "delivered", + "target_event_id": "$WEIGFHFW:localhost" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message.feedback", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.message_m.emote b/event-schemas/examples/v1/m.room.message_m.emote new file mode 100644 index 00000000..bd984831 --- /dev/null +++ b/event-schemas/examples/v1/m.room.message_m.emote @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "body": "thinks this is an example emote", + "msgtype": "m.emote" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.message_m.image b/event-schemas/examples/v1/m.room.message_m.image new file mode 100644 index 00000000..ba405a1a --- /dev/null +++ b/event-schemas/examples/v1/m.room.message_m.image @@ -0,0 +1,19 @@ +{ + "age": 242352, + "content": { + "body": "filename.jpg", + "info": { + "h": 398, + "w": 394, + "mimetype": "image/jpeg", + "size": 31037 + }, + "url": "mxc://localhost/JWEIFJgwEIhweiWJE", + "msgtype": "m.image" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.message_m.notice b/event-schemas/examples/v1/m.room.message_m.notice new file mode 100644 index 00000000..2e5fff97 --- /dev/null +++ b/event-schemas/examples/v1/m.room.message_m.notice @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "body": "This is an example notice", + "msgtype": "m.notice" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.message_m.text b/event-schemas/examples/v1/m.room.message_m.text new file mode 100644 index 00000000..d877ee64 --- /dev/null +++ b/event-schemas/examples/v1/m.room.message_m.text @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "body": "This is an example text message", + "msgtype": "m.text" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.name b/event-schemas/examples/v1/m.room.name new file mode 100644 index 00000000..636119b8 --- /dev/null +++ b/event-schemas/examples/v1/m.room.name @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "name": "The room name" + }, + "state_key": "", + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.name", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.power_levels b/event-schemas/examples/v1/m.room.power_levels new file mode 100644 index 00000000..8278597a --- /dev/null +++ b/event-schemas/examples/v1/m.room.power_levels @@ -0,0 +1,24 @@ +{ + "age": 242352, + "content": { + "ban": 50, + "events": { + "m.room.name": 100, + "m.room.power_levels": 100 + }, + "events_default": 0, + "kick": 50, + "redact": 50, + "state_default": 50, + "users": { + "@example:localhost": 100 + }, + "users_default": 0 + }, + "state_key": "", + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.power_levels", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.redaction b/event-schemas/examples/v1/m.room.redaction new file mode 100644 index 00000000..dd56e97c --- /dev/null +++ b/event-schemas/examples/v1/m.room.redaction @@ -0,0 +1,10 @@ +{ + "age": 242352, + "content": {}, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.redaction", + "room_id": "!Cuyf34gef24t:localhost", + "redacts": "!fukweghifu23:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/v1/m.room.topic b/event-schemas/examples/v1/m.room.topic new file mode 100644 index 00000000..8a469122 --- /dev/null +++ b/event-schemas/examples/v1/m.room.topic @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "topic": "A room topic" + }, + "state_key": "", + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.topic", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/schema/v1/core b/event-schemas/schema/v1/core new file mode 100644 index 00000000..11d931d5 --- /dev/null +++ b/event-schemas/schema/v1/core @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "event": { + "title": "Event", + "description": "The basic set of fields all events must have.", + "type": "object", + "properties": { + "event_id": { + "type": "string", + "description": "The globally unique event identifier." + }, + "user_id": { + "type": "string" + }, + "content": { + "type": "object", + "description": "The fields in this object will vary depending on the type of event." + }, + "type": { + "type": "string", + "description": "The type of event. This SHOULD be namespaced similar to Java package naming conventions e.g. 'com.example.subdomain.event.type'" + } + }, + "required": ["event_id", "user_id", "content", "type"] + }, + "room_event": { + "type": "object", + "title": "Room Event", + "description": "The basic set of fields all room events must have.", + "allOf":[{ + "$ref": "#/definitions/event" + }], + "properties": { + "room_id": { + "type": "string" + } + }, + "required": ["room_id"] + }, + "state_event": { + "type": "object", + "title": "State Event", + "description": "The basic set of fields which define a room state event.", + "allOf":[{ + "$ref": "#/definitions/room_event" + }], + "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 0-length string." + }, + "prev_content": { + "type": "object", + "description": "The previous content if this event has overwritten another event." + } + }, + "required": ["state_key"] + } + } +} diff --git a/event-schemas/schema/v1/m.call.answer b/event-schemas/schema/v1/m.call.answer new file mode 100644 index 00000000..8976aa33 --- /dev/null +++ b/event-schemas/schema/v1/m.call.answer @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "call_id": { + "type": "string" + }, + "answer": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["answer"] + }, + "sdp": { + "type": "string" + } + }, + "required": ["type", "sdp"] + }, + "version": { + "type": "number" + } + }, + "required": ["call_id", "answer", "version"] + }, + "type": { + "type": "string", + "enum": ["m.call.answer"] + } + } +} diff --git a/event-schemas/schema/v1/m.call.candidates b/event-schemas/schema/v1/m.call.candidates new file mode 100644 index 00000000..0a2937a1 --- /dev/null +++ b/event-schemas/schema/v1/m.call.candidates @@ -0,0 +1,43 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "call_id": { + "type": "string" + }, + "candidates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sdpMid": { + "type": "string" + }, + "sdpMLineIndex": { + "type": "number" + }, + "candidate": { + "type": "string" + } + }, + "required": ["candidate", "sdpMLineIndex", "sdpMid"] + } + }, + "version": { + "type": "number" + } + }, + "required": ["call_id", "candidates", "version"] + }, + "type": { + "type": "string", + "enum": ["m.call.candidates"] + } + } +} diff --git a/event-schemas/schema/v1/m.call.hangup b/event-schemas/schema/v1/m.call.hangup new file mode 100644 index 00000000..48d008b9 --- /dev/null +++ b/event-schemas/schema/v1/m.call.hangup @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "call_id": { + "type": "string" + }, + "version": { + "type": "number" + } + }, + "required": ["call_id", "version"] + }, + "type": { + "type": "string", + "enum": ["m.call.hangup"] + } + } +} diff --git a/event-schemas/schema/v1/m.call.invite b/event-schemas/schema/v1/m.call.invite new file mode 100644 index 00000000..4bdbccab --- /dev/null +++ b/event-schemas/schema/v1/m.call.invite @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "call_id": { + "type": "string" + }, + "offer": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["offer"] + }, + "sdp": { + "type": "string" + } + }, + "required": ["type", "sdp"] + }, + "version": { + "type": "number" + } + }, + "required": ["call_id", "offer", "version"] + }, + "type": { + "type": "string", + "enum": ["m.call.invite"] + } + } +} diff --git a/event-schemas/schema/v1/m.presence b/event-schemas/schema/v1/m.presence new file mode 100644 index 00000000..815c6af9 --- /dev/null +++ b/event-schemas/schema/v1/m.presence @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "content": { + "type": "object", + "properties": { + "avatar_url": { + "type": "string" + }, + "displayname": { + "type": "string" + }, + "last_active_ago": { + "type": "number" + }, + "presence": { + "type": "string", + "enum": ["online", "offline", "unavailable", "free_for_chat", "hidden"] + }, + "user_id": { + "type": "string" + } + }, + "required": ["presence", "user_id"] + }, + "type": { + "type": "string", + "enum": ["m.presence"] + }, + "event_id": { + "type": "string" + } + }, + "required": ["event_id", "type", "content"] +} diff --git a/event-schemas/schema/v1/m.room.aliases b/event-schemas/schema/v1/m.room.aliases new file mode 100644 index 00000000..6c91eed7 --- /dev/null +++ b/event-schemas/schema/v1/m.room.aliases @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/state_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["aliases"] + }, + "type": { + "type": "string", + "enum": ["m.room.aliases"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.create b/event-schemas/schema/v1/m.room.create new file mode 100644 index 00000000..9e6e83bd --- /dev/null +++ b/event-schemas/schema/v1/m.room.create @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/state_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "creator": { + "type": "string" + } + }, + "required": ["creator"] + }, + "state_key": { + "type": "string", + "pattern": "^$" + }, + "type": { + "type": "string", + "enum": ["m.room.create"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.join_rules b/event-schemas/schema/v1/m.room.join_rules new file mode 100644 index 00000000..3954a962 --- /dev/null +++ b/event-schemas/schema/v1/m.room.join_rules @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/state_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "join_rule": { + "type": "string", + "enum": ["public","knock","invite","private"] + } + }, + "required": ["join_rule"] + }, + "state_key": { + "type": "string", + "pattern": "^$" + }, + "type": { + "type": "string", + "enum": ["m.room.join_rules"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.member b/event-schemas/schema/v1/m.room.member new file mode 100644 index 00000000..76b4c360 --- /dev/null +++ b/event-schemas/schema/v1/m.room.member @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/state_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "membership": { + "type": "string", + "enum": ["invite","join","knock","leave","ban"] + } + }, + "required": ["membership"] + }, + "state_key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["m.room.member"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.message b/event-schemas/schema/v1/m.room.message new file mode 100644 index 00000000..2b00dfd0 --- /dev/null +++ b/event-schemas/schema/v1/m.room.message @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "msgtype": { + "type": "string" + }, + "body": { + "type": "string" + } + }, + "required": ["msgtype", "body"] + }, + "type": { + "type": "string", + "enum": ["m.room.message"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.message.feedback b/event-schemas/schema/v1/m.room.message.feedback new file mode 100644 index 00000000..392e630d --- /dev/null +++ b/event-schemas/schema/v1/m.room.message.feedback @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["delivered", "read"] + }, + "target_event_id": { + "type": "string" + } + }, + "required": ["type", "target_event_id"] + }, + "type": { + "type": "string", + "enum": ["m.room.message.feedback"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.name b/event-schemas/schema/v1/m.room.name new file mode 100644 index 00000000..6dca3b14 --- /dev/null +++ b/event-schemas/schema/v1/m.room.name @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/state_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": ["name"] + }, + "state_key": { + "type": "string", + "pattern": "^$" + }, + "type": { + "type": "string", + "enum": ["m.room.name"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.power_levels b/event-schemas/schema/v1/m.room.power_levels new file mode 100644 index 00000000..91621149 --- /dev/null +++ b/event-schemas/schema/v1/m.room.power_levels @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/state_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "ban": { "type": "number" }, + "events_default": { "type": "number" }, + "kick": { "type": "number" }, + "redact": { "type": "number" }, + "state_default": { "type": "number" }, + "users_default": { "type": "number" }, + "events": { + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "users": { + "type": "object", + "additionalProperties": { + "type": "number" + } + } + }, + "required": ["ban","events","events_default","kick","redact", + "state_default","users","users_default"] + }, + "state_key": { + "type": "string", + "pattern": "^$" + }, + "type": { + "type": "string", + "enum": ["m.room.power_levels"] + } + } +} diff --git a/event-schemas/schema/v1/m.room.redaction b/event-schemas/schema/v1/m.room.redaction new file mode 100644 index 00000000..5b5dd6db --- /dev/null +++ b/event-schemas/schema/v1/m.room.redaction @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/room_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + }, + "redacts": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["m.room.redaction"] + } + }, + "required": ["redacts"] +} diff --git a/event-schemas/schema/v1/m.room.topic b/event-schemas/schema/v1/m.room.topic new file mode 100644 index 00000000..80ae1191 --- /dev/null +++ b/event-schemas/schema/v1/m.room.topic @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "allOf": [{ + "$ref": "core#/definitions/state_event" + }], + "properties": { + "content": { + "type": "object", + "properties": { + "topic": { + "type": "string" + } + }, + "required": ["topic"] + }, + "state_key": { + "type": "string", + "pattern": "^$" + }, + "type": { + "type": "string", + "enum": ["m.room.topic"] + } + } +}