mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-01-04 23:13:43 +01:00
Rename "schema/v1/core" to "schema/v1/core-event-schema". Add self-referential symlinks to schema/v1/core-event-schema The python json schema libraries expect that relative references are relative to the file they are in. The node json schema libraries expect that relateive references are relative to the first file loaded. To support both kinds we reference the core event schema using "core-event-schema/event.json". We then symlink the core-event-schema directory to both the location of the file refering to "event.json" so that it will work in python and to the location of the top level file so that it will work in node.
65 lines
2.3 KiB
Plaintext
65 lines
2.3 KiB
Plaintext
{
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
"type": "object",
|
|
"title": "FileMessage",
|
|
"description": "This message represents a generic file.",
|
|
"allOf": [{
|
|
"$ref": "core-event-schema/room_event.json"
|
|
}],
|
|
"properties": {
|
|
"content": {
|
|
"type": "object",
|
|
"properties": {
|
|
"msgtype": {
|
|
"type": "string",
|
|
"enum": ["m.file"]
|
|
},
|
|
"filename": {
|
|
"type": "string",
|
|
"description": "The original filename of the uploaded file."
|
|
},
|
|
"body": {
|
|
"type": "string",
|
|
"description": "A human-readable description of the file. This is recommended to be the filename of the original upload."
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "The URL to the file."
|
|
},
|
|
"info": {
|
|
"type": "object",
|
|
"title": "FileInfo",
|
|
"description": "Information about the file referred to in ``url``.",
|
|
"properties": {
|
|
"size": {
|
|
"type": "integer",
|
|
"description": "The size of the file in bytes."
|
|
},
|
|
"mimetype": {
|
|
"type": "string",
|
|
"description": "The mimetype of the file e.g. ``application/msword``."
|
|
}
|
|
}
|
|
},
|
|
"thumbnail_url": {
|
|
"type": "string",
|
|
"description": "The URL to the thumbnail of the file."
|
|
},
|
|
"thumbnail_info": {
|
|
"type": "object",
|
|
"title": "ImageInfo",
|
|
"description": "Metadata about the image referred to in ``thumbnail_url``.",
|
|
"allOf": [{
|
|
"$ref": "core-event-schema/msgtype_infos/image_info.json"
|
|
}]
|
|
}
|
|
},
|
|
"required": ["msgtype", "body", "url", "filename"]
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["m.room.message"]
|
|
}
|
|
}
|
|
}
|