Add a thumbnail_info common schema, deduplicate m.room.avatar and m.room.message#m.image

This commit is contained in:
Mark Haines 2016-11-07 10:50:52 +00:00
parent 1b661b64dc
commit 2fdca5a995
7 changed files with 33 additions and 37 deletions

View file

@ -13,4 +13,13 @@ properties:
w:
description: The width of the image in pixels.
type: integer
thumbnail_url:
desciption: The URL to a thumbnail of the image.
type: string
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
title: ThumbnailInfo
type: object
title: ImageInfo

View file

@ -0,0 +1,16 @@
$schema: http://json-schema.org/draft-04/schema#
description: Metadata about a thumbnail image.
properties:
h:
description: The height of the image in pixels.
type: integer
mimetype:
description: The mimetype of the image, e.g. ``image/jpeg``.
type: string
size:
description: Size of the image in bytes.
type: integer
w:
description: The width of the image in pixels.
type: integer
title: ThumbnailInfo

View file

@ -11,15 +11,6 @@ properties:
description: Metadata about the image referred to in ``url``.
title: ImageInfo
type: object
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
title: ImageInfo
type: object
thumbnail_url:
description: The URL to the thumbnail of the image.
type: string
url:
description: The URL to the image.
type: string

View file

@ -22,9 +22,9 @@ properties:
type: integer
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
title: ImageInfo
title: ThumbnailInfo
type: object
thumbnail_url:
description: The URL to the thumbnail of the file.

View file

@ -9,29 +9,9 @@ properties:
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'."
type: string
info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
description: Metadata about the image referred to in ``url``.
properties:
h:
description: The height of the image in pixels.
type: integer
mimetype:
description: 'The mimetype of the image, e.g. ``image/jpeg``.'
type: string
size:
description: Size of the image in bytes.
type: integer
w:
description: The width of the image in pixels.
type: integer
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
title: ImageInfo
type: object
thumbnail_url:
description: The URL to the thumbnail of the image.
type: string
title: ImageInfo
type: object
msgtype:

View file

@ -20,8 +20,8 @@ properties:
properties:
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
title: ImageInfo
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
title: ThumbnailInfo
type: object
thumbnail_url:
description: The URL to a thumbnail of the location being represented.

View file

@ -25,8 +25,8 @@ properties:
type: integer
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
title: ImageInfo
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
title: ThumbnailInfo
type: object
thumbnail_url:
description: The URL to a thumbnail of the video clip.