Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert event schemas to yaml #338

Merged
merged 2 commits into from
Jun 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 24 additions & 31 deletions event-schemas/schema/m.room.aliases
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
{
"type": "object",
"title": "Informs the room about what room aliases it has been given.",
"description": "This event is sent by a homeserver directly to inform of changes to the list of aliases it knows about for that room. The ``state_key`` for this event is set to the homeserver which owns the room alias. The entire set of known aliases for the room is the union of all the ``m.room.aliases`` events, one for each homeserver. Clients **should** check the validity of any room alias given in this list before presenting it to the user as trusted fact. The lists given by this event should be considered simply as advice on which aliases might exist, for which the client can perform the lookup to confirm whether it receives the correct room ID.",
"allOf": [{
"$ref": "core-event-schema/state_event.yaml"
}],
"properties": {
"content": {
"type": "object",
"properties": {
"aliases": {
"type": "array",
"description": "A list of room aliases.",
"items": {
"type": "string"
}
}
},
"required": ["aliases"]
},
"state_key": {
"type": "string",
"description": "The homeserver domain which owns these room aliases."
},
"type": {
"type": "string",
"enum": ["m.room.aliases"]
}
}
}
---
allOf:
- $ref: core-event-schema/state_event.yaml
description: 'This event is sent by a homeserver directly to inform of changes to the list of aliases it knows about for that room. The ``state_key`` for this event is set to the homeserver which owns the room alias. The entire set of known aliases for the room is the union of all the ``m.room.aliases`` events, one for each homeserver. Clients **should** check the validity of any room alias given in this list before presenting it to the user as trusted fact. The lists given by this event should be considered simply as advice on which aliases might exist, for which the client can perform the lookup to confirm whether it receives the correct room ID.'
properties:
content:
properties:
aliases:
description: A list of room aliases.
items:
type: string
type: array
required:
- aliases
type: object
state_key:
description: The homeserver domain which owns these room aliases.
type: string
type:
enum:
- m.room.aliases
type: string
title: Informs the room about what room aliases it has been given.
type: object
87 changes: 38 additions & 49 deletions event-schemas/schema/m.room.avatar
Original file line number Diff line number Diff line change
@@ -1,49 +1,38 @@
{
"title": "RoomAvatar",
"description": "A picture that is associated with the room. This can be displayed alongside the room information.",
"type": "object",
"allOf": [{
"$ref": "core-event-schema/state_event.yaml"
}],
"properties": {
"content": {
"type": "object",
"properties": {
"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.yaml"
}]
},
"info": {
"type": "object",
"title": "ImageInfo",
"description": "Metadata about the image referred to in ``url``.",
"allOf": [{
"$ref": "core-event-schema/msgtype_infos/image_info.yaml"
}]
}
},
"required": ["url"]
},
"state_key": {
"type": "string",
"description": "A zero-length string.",
"pattern": "^$"
},
"type": {
"type": "string",
"enum": ["m.room.avatar"]
}
}
}
---
allOf:
- $ref: core-event-schema/state_event.yaml
description: A picture that is associated with the room. This can be displayed alongside the room information.
properties:
content:
properties:
info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
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
required:
- url
type: object
state_key:
description: A zero-length string.
pattern: '^$'
type: string
type:
enum:
- m.room.avatar
type: string
title: RoomAvatar
type: object
49 changes: 21 additions & 28 deletions event-schemas/schema/m.room.canonical_alias
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
{
"type": "object",
"title": "Informs the room as to which alias is the canonical one.",
"description": "This event is used to inform the room about which alias should be considered the canonical one. This could be for display purposes or as suggestion to users which alias to use to advertise the room.",
"allOf": [{
"$ref": "core-event-schema/state_event.yaml"
}],
"properties": {
"content": {
"type": "object",
"properties": {
"alias": {
"type": "string",
"description": "The canonical alias."
}
}
},
"state_key": {
"type": "string",
"description": "A zero-length string.",
"pattern": "^$"
},
"type": {
"type": "string",
"enum": ["m.room.canonical_alias"]
}
}
}
---
allOf:
- $ref: core-event-schema/state_event.yaml
description: This event is used to inform the room about which alias should be considered the canonical one. This could be for display purposes or as suggestion to users which alias to use to advertise the room.
properties:
content:
properties:
alias:
description: The canonical alias.
type: string
type: object
state_key:
description: A zero-length string.
pattern: '^$'
type: string
type:
enum:
- m.room.canonical_alias
type: string
title: Informs the room as to which alias is the canonical one.
type: object
59 changes: 26 additions & 33 deletions event-schemas/schema/m.room.create
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
{
"type": "object",
"title": "The first event in the room.",
"description": "This is the first event in a room and cannot be changed. It acts as the root of all other events.",
"allOf": [{
"$ref": "core-event-schema/state_event.yaml"
}],
"properties": {
"content": {
"type": "object",
"properties": {
"creator": {
"type": "string",
"description": "The ``user_id`` of the room creator. This is set by the homeserver."
},
"m.federate": {
"type": "boolean",
"description": "Whether users on other servers can join this room. Defaults to ``true`` if key does not exist."
}
},
"required": ["creator"]
},
"state_key": {
"type": "string",
"description": "A zero-length string.",
"pattern": "^$"
},
"type": {
"type": "string",
"enum": ["m.room.create"]
}
}
}
---
allOf:
- $ref: core-event-schema/state_event.yaml
description: This is the first event in a room and cannot be changed. It acts as the root of all other events.
properties:
content:
properties:
creator:
description: The ``user_id`` of the room creator. This is set by the homeserver.
type: string
m.federate:
description: Whether users on other servers can join this room. Defaults to ``true`` if key does not exist.
type: boolean
required:
- creator
type: object
state_key:
description: A zero-length string.
pattern: '^$'
type: string
type:
enum:
- m.room.create
type: string
title: The first event in the room.
type: object
56 changes: 26 additions & 30 deletions event-schemas/schema/m.room.guest_access
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
{
"type": "object",
"title": "Controls whether guest users are allowed to join rooms.",
"description": "This event controls whether guest users are allowed to join rooms. If this event is absent, servers should act as if it is present and has the guest_access value \"forbidden\".",
"allOf": [{
"$ref": "core-event-schema/state_event.yaml"
}],
"properties": {
"content": {
"type": "object",
"properties": {
"guest_access": {
"type": "string",
"description": "Whether guests can join the room.",
"enum": ["can_join", "forbidden"]
}
},
"required": ["guest_access"]
},
"state_key": {
"type": "string",
"description": "A zero-length string.",
"pattern": "^$"
},
"type": {
"type": "string",
"enum": ["m.room.guest_access"]
}
}
}
---
allOf:
- $ref: core-event-schema/state_event.yaml
description: 'This event controls whether guest users are allowed to join rooms. If this event is absent, servers should act as if it is present and has the guest_access value "forbidden".'
properties:
content:
properties:
guest_access:
description: Whether guests can join the room.
enum:
- can_join
- forbidden
type: string
required:
- guest_access
type: object
state_key:
description: A zero-length string.
pattern: '^$'
type: string
type:
enum:
- m.room.guest_access
type: string
title: Controls whether guest users are allowed to join rooms.
type: object
58 changes: 28 additions & 30 deletions event-schemas/schema/m.room.history_visibility
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
{
"type": "object",
"title": "Controls visibility of history.",
"description": "This event controls whether a user can see the events that happened in a room from before they joined.",
"allOf": [{
"$ref": "core-event-schema/state_event.yaml"
}],
"properties": {
"content": {
"type": "object",
"properties": {
"history_visibility": {
"type": "string",
"description": "Who can see the room history.",
"enum": ["invited","joined","shared","world_readable"]
}
},
"required": ["history_visibility"]
},
"state_key": {
"type": "string",
"description": "A zero-length string.",
"pattern": "^$"
},
"type": {
"type": "string",
"enum": ["m.room.history_visibility"]
}
}
}
---
allOf:
- $ref: core-event-schema/state_event.yaml
description: This event controls whether a user can see the events that happened in a room from before they joined.
properties:
content:
properties:
history_visibility:
description: Who can see the room history.
enum:
- invited
- joined
- shared
- world_readable
type: string
required:
- history_visibility
type: object
state_key:
description: A zero-length string.
pattern: '^$'
type: string
type:
enum:
- m.room.history_visibility
type: string
title: Controls visibility of history.
type: object
Loading