mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-19 09:54:09 +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.
69 lines
2.6 KiB
Plaintext
69 lines
2.6 KiB
Plaintext
{
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
"type": "object",
|
|
"title": "ImageMessage",
|
|
"description": "This message represents a single image and an optional thumbnail.",
|
|
"allOf": [{
|
|
"$ref": "core-event-schema/room_event.json"
|
|
}],
|
|
"properties": {
|
|
"content": {
|
|
"type": "object",
|
|
"properties": {
|
|
"msgtype": {
|
|
"type": "string",
|
|
"enum": ["m.image"]
|
|
},
|
|
"body": {
|
|
"type": "string",
|
|
"description": "A textual representation of the image. This could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. 'image attachment'."
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "The URL to the image."
|
|
},
|
|
"thumbnail_url": {
|
|
"type": "string",
|
|
"description": "The URL to the thumbnail of the image."
|
|
},
|
|
"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"
|
|
}]
|
|
},
|
|
"info": {
|
|
"type": "object",
|
|
"title": "ImageInfo",
|
|
"description": "Metadata about the image referred to in ``url``.",
|
|
"properties": {
|
|
"size": {
|
|
"type": "integer",
|
|
"description": "Size of the image in bytes."
|
|
},
|
|
"w": {
|
|
"type": "integer",
|
|
"description": "The width of the image in pixels."
|
|
},
|
|
"h": {
|
|
"type": "integer",
|
|
"description": "The height of the image in pixels."
|
|
},
|
|
"mimetype": {
|
|
"type": "string",
|
|
"description": "The mimetype of the image, e.g. ``image/jpeg``."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": ["msgtype", "body", "url"]
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["m.room.message"]
|
|
}
|
|
}
|
|
}
|