Add m.room.topic. Add title/descs. Add 'type' key checking.
This commit is contained in:
parent
809ec63b9c
commit
5216b1ac8a
5 changed files with 64 additions and 4 deletions
12
event-schemas/examples/m.room.topic
Normal file
12
event-schemas/examples/m.room.topic
Normal file
|
@ -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"
|
||||
}
|
|
@ -2,25 +2,32 @@
|
|||
"$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"
|
||||
"type": "string",
|
||||
"description": "The globally unique event identifier."
|
||||
},
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
"type": "object"
|
||||
"type": "object",
|
||||
"description": "The fields in this object will vary depending on the type of event."
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
"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"
|
||||
}],
|
||||
|
@ -33,12 +40,19 @@
|
|||
},
|
||||
"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"
|
||||
"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"]
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
}
|
||||
},
|
||||
"required": ["msgtype", "body"]
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["m.room.message"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
"state_key": {
|
||||
"type": "string",
|
||||
"pattern": "^$"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["m.room.name"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
26
event-schemas/schema/m.room.topic
Normal file
26
event-schemas/schema/m.room.topic
Normal file
|
@ -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"]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue