mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-01-10 01:43:43 +01:00
Add event-schema directory and m.room.message schema.
This commit is contained in:
parent
bfec7752cb
commit
f0188a46d1
35
event-schemas/core
Normal file
35
event-schemas/core
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"definitions": {
|
||||
"event": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"event_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
"type": "object"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["event_id", "user_id", "content", "type"]
|
||||
},
|
||||
"room_event": {
|
||||
"type": "object",
|
||||
"allOf":[{
|
||||
"$ref": "#/definitions/event"
|
||||
}],
|
||||
"properties": {
|
||||
"room_id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["room_id"]
|
||||
}
|
||||
}
|
||||
}
|
||||
21
event-schemas/m.room.message
Normal file
21
event-schemas/m.room.message
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"$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"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue