Format examples as raw objects
According the the openapi spec, examples for responses and schemas should be raw objects rather than being json strings. (It's unclear what non-json examples should look like...). The swagger UI used to support json strings, but no longer does. In short, let's turn the json strings into their raw formats.
This commit is contained in:
parent
0795f3667e
commit
820704a16a
44 changed files with 183 additions and 290 deletions
|
@ -45,8 +45,7 @@ paths:
|
|||
description: A list of events
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"events": [
|
||||
{
|
||||
"age": 32,
|
||||
|
@ -87,8 +86,8 @@ paths:
|
|||
200:
|
||||
description: The transaction was processed successfully.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
|
||||
|
@ -117,8 +116,8 @@ paths:
|
|||
information about the room such as its name and topic can be set
|
||||
before responding.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
|
@ -126,8 +125,7 @@ paths:
|
|||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
|
@ -136,8 +134,7 @@ paths:
|
|||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
|
@ -147,8 +144,7 @@ paths:
|
|||
The application service indicates that this room alias does not exist.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
|
@ -175,8 +171,8 @@ paths:
|
|||
The application service indicates that this user exists. The application
|
||||
service MUST create the user using the client-server API.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
|
@ -184,8 +180,7 @@ paths:
|
|||
The homeserver has not supplied credentials to the application service.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_UNAUTHORIZED"
|
||||
}
|
||||
schema:
|
||||
|
@ -194,8 +189,7 @@ paths:
|
|||
description: |-
|
||||
The credentials supplied by the homeserver were rejected.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN"
|
||||
}
|
||||
schema:
|
||||
|
@ -205,8 +199,7 @@ paths:
|
|||
The application service indicates that this user does not exist.
|
||||
Optional error information can be included in the body of this response.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "COM.EXAMPLE.MYAPPSERVICE_NOT_FOUND"
|
||||
}
|
||||
schema:
|
||||
|
|
|
@ -45,15 +45,8 @@ except ImportError as e:
|
|||
|
||||
def check_parameter(filepath, request, parameter):
|
||||
schema = parameter.get("schema")
|
||||
example = None
|
||||
try:
|
||||
example_json = schema.get('example')
|
||||
if example_json and not schema.get("format") == "byte":
|
||||
example = json.loads(example_json)
|
||||
except Exception as e:
|
||||
raise ValueError("Error parsing JSON example request for %r" % (
|
||||
request
|
||||
), e)
|
||||
example = schema.get('example')
|
||||
|
||||
fileurl = "file://" + os.path.abspath(filepath)
|
||||
if example and schema:
|
||||
try:
|
||||
|
@ -72,15 +65,7 @@ def check_parameter(filepath, request, parameter):
|
|||
|
||||
|
||||
def check_response(filepath, request, code, response):
|
||||
example = None
|
||||
try:
|
||||
example_json = response.get('examples', {}).get('application/json')
|
||||
if example_json:
|
||||
example = json.loads(example_json)
|
||||
except Exception as e:
|
||||
raise ValueError("Error parsing JSON example response for %r %r" % (
|
||||
request, code
|
||||
), e)
|
||||
example = response.get('examples', {}).get('application/json')
|
||||
schema = response.get('schema')
|
||||
fileurl = "file://" + os.path.abspath(filepath)
|
||||
if example and schema:
|
||||
|
|
|
@ -60,8 +60,8 @@ paths:
|
|||
The content of the account_data
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{"custom_account_data_key": "custom_config_value"}
|
||||
example: {
|
||||
"custom_account_data_key": "custom_config_value"}
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
|
@ -108,8 +108,8 @@ paths:
|
|||
The content of the account_data
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{"custom_account_data_key": "custom_account_data_value"}
|
||||
example: {
|
||||
"custom_account_data_key": "custom_account_data_value"}
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
|
|
|
@ -49,8 +49,7 @@ paths:
|
|||
200:
|
||||
description: The lookup was successful.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"user_id": "@peter:rabbit.rocks",
|
||||
"devices": {
|
||||
"teapot": {
|
||||
|
|
|
@ -45,8 +45,7 @@ paths:
|
|||
200:
|
||||
description: The lookup was successful.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"threepids": [
|
||||
{
|
||||
"medium": "email",
|
||||
|
@ -106,8 +105,7 @@ paths:
|
|||
server. Default: ``false``.
|
||||
x-example: true
|
||||
required: ["three_pid_creds"]
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"three_pid_creds": {
|
||||
"id_server": "matrix.org",
|
||||
"sid": "abc123987",
|
||||
|
@ -119,14 +117,13 @@ paths:
|
|||
200:
|
||||
description: The addition was successful.
|
||||
examples:
|
||||
application/json: "{}"
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
description: The credentials could not be verified with the identity server.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_THREEPID_AUTH_FAILED",
|
||||
"error": "The third party credentials could not be verified by the identity server."
|
||||
}
|
||||
|
|
|
@ -50,8 +50,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"reason": "Telling unfunny jokes",
|
||||
"user_id": "@cheeky_monkey:matrix.org"
|
||||
}
|
||||
|
@ -67,8 +66,8 @@ paths:
|
|||
200:
|
||||
description: The user has been kicked and banned from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
|
@ -78,8 +77,7 @@ paths:
|
|||
- The banner is not currently in the room.
|
||||
- The banner's power level is insufficient to ban users from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "You do not have a high enough power level to ban from this room."
|
||||
}
|
||||
|
@ -107,8 +105,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"user_id": "@cheeky_monkey:matrix.org"
|
||||
}
|
||||
properties:
|
||||
|
@ -120,8 +117,8 @@ paths:
|
|||
200:
|
||||
description: The user has been unbanned from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
|
@ -130,8 +127,7 @@ paths:
|
|||
|
||||
- The unbanner's power level is insufficient to unban users from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "You do not have a high enough power level to unban from this room."
|
||||
}
|
||||
|
|
|
@ -57,8 +57,7 @@ paths:
|
|||
type: string
|
||||
description: "The MXC URI to the uploaded content."
|
||||
examples:
|
||||
"application/json": |-
|
||||
{
|
||||
application/json: {
|
||||
"content_uri": "mxc://example.com/AQwafuaFswefuhsfAFAgsw"
|
||||
}
|
||||
tags:
|
||||
|
|
|
@ -54,8 +54,7 @@ paths:
|
|||
description: The desired room configuration.
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"preset": "public_chat",
|
||||
"room_alias_name": "thepub",
|
||||
"name": "The Grand Duke Pub",
|
||||
|
@ -188,8 +187,7 @@ paths:
|
|||
description: |-
|
||||
The created room's ID.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"room_id": "!sefiuhWgwghwWgh:example.com"
|
||||
}
|
||||
400:
|
||||
|
|
|
@ -49,8 +49,7 @@ paths:
|
|||
allOf:
|
||||
- $ref: "definitions/client_device.yaml"
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"devices": [
|
||||
{
|
||||
"device_id": "QBUAZIFURK",
|
||||
|
@ -84,8 +83,7 @@ paths:
|
|||
allOf:
|
||||
- $ref: "definitions/client_device.yaml"
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"device_id": "QBUAZIFURK",
|
||||
"display_name": "android",
|
||||
"last_seen_ip": "1.2.3.4",
|
||||
|
@ -125,8 +123,8 @@ paths:
|
|||
200:
|
||||
description: The device was successfully updated.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
404:
|
||||
|
@ -166,8 +164,8 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
401:
|
||||
description: |-
|
||||
The homeserver requires additional authentication information.
|
||||
|
|
|
@ -49,23 +49,21 @@ paths:
|
|||
room_id:
|
||||
type: string
|
||||
description: The room ID to set.
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"room_id": "!abnjk1jdasj98:capuchins.com"
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: The mapping was created.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
409:
|
||||
description: A room alias with that name already exists.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_UNKNOWN",
|
||||
"error": "Room alias #monkeys:matrix.org already exists."
|
||||
}
|
||||
|
@ -103,8 +101,7 @@ paths:
|
|||
type: string
|
||||
description: A server which is aware of this room alias.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"room_id": "!abnjk1jdasj98:capuchins.com",
|
||||
"servers": [
|
||||
"capuchins.com",
|
||||
|
@ -115,8 +112,7 @@ paths:
|
|||
404:
|
||||
description: There is no mapped room ID for this room alias.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_NOT_FOUND",
|
||||
"error": "Room alias #monkeys:matrix.org not found."
|
||||
}
|
||||
|
@ -141,8 +137,8 @@ paths:
|
|||
200:
|
||||
description: The mapping was deleted.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
tags:
|
||||
|
|
|
@ -99,8 +99,7 @@ paths:
|
|||
allOf:
|
||||
- "$ref": "definitions/event-schemas/schema/core-event-schema/state_event.yaml"
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"end": "t29-57_2_0_2",
|
||||
"events_after": [
|
||||
{
|
||||
|
|
|
@ -52,8 +52,7 @@ paths:
|
|||
type: object
|
||||
allOf:
|
||||
- $ref: "definitions/sync_filter.yaml"
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"room": {
|
||||
"state": {
|
||||
"types": ["m.room.*"],
|
||||
|
@ -82,8 +81,7 @@ paths:
|
|||
200:
|
||||
description: The filter was created.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"filter_id": "66696p746572"
|
||||
}
|
||||
schema:
|
||||
|
@ -120,8 +118,7 @@ paths:
|
|||
description: |-
|
||||
"The filter defintion"
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"room": {
|
||||
"state": {
|
||||
"types": ["m.room.*"],
|
||||
|
|
|
@ -65,8 +65,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"user_id": "@cheeky_monkey:matrix.org"
|
||||
}
|
||||
properties:
|
||||
|
@ -78,8 +77,8 @@ paths:
|
|||
200:
|
||||
description: The user has been invited to join the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
|
@ -91,8 +90,8 @@ paths:
|
|||
- The inviter is not currently in the room.
|
||||
- The inviter's power level is insufficient to invite users to the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"errcode": "M_FORBIDDEN", "error": "@cheeky_monkey:matrix.org is banned from the room"}
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN", "error": "@cheeky_monkey:matrix.org is banned from the room"}
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
|
|
|
@ -57,8 +57,7 @@ paths:
|
|||
name: third_party_signed
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"third_party_signed": {
|
||||
"sender": "@cat:the.hat",
|
||||
"mxid": "@green:eggs.ham",
|
||||
|
@ -97,8 +96,8 @@ paths:
|
|||
|
||||
The joined room ID must be returned in the ``room_id`` field.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"room_id": "!d41d8cd:matrix.org"}
|
||||
application/json: {
|
||||
"room_id": "!d41d8cd:matrix.org"}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
|
@ -108,8 +107,8 @@ paths:
|
|||
- The room is invite-only and the user was not invited.
|
||||
- The user has been banned from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"errcode": "M_FORBIDDEN", "error": "You are not invited to this room."}
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN", "error": "You are not invited to this room."}
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
|
@ -146,8 +145,7 @@ paths:
|
|||
name: third_party_signed
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"third_party_signed": {
|
||||
"signed": {
|
||||
"sender": "@cat:the.hat",
|
||||
|
@ -193,8 +191,8 @@ paths:
|
|||
|
||||
The joined room ID must be returned in the ``room_id`` field.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"room_id": "!d41d8cd:matrix.org"}
|
||||
application/json: {
|
||||
"room_id": "!d41d8cd:matrix.org"}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
|
@ -204,8 +202,8 @@ paths:
|
|||
- The room is invite-only and the user was not invited.
|
||||
- The user has been banned from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"errcode": "M_FORBIDDEN", "error": "You are not invited to this room."}
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN", "error": "You are not invited to this room."}
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
|
|
|
@ -48,8 +48,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"reason": "Telling unfunny jokes",
|
||||
"user_id": "@cheeky_monkey:matrix.org"
|
||||
}
|
||||
|
@ -65,8 +64,8 @@ paths:
|
|||
200:
|
||||
description: The user has been kicked from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
|
@ -77,8 +76,7 @@ paths:
|
|||
- The kickee is not currently in the room.
|
||||
- The kicker's power level is insufficient to kick users from the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "You do not have a high enough power level to kick from this room."
|
||||
}
|
||||
|
|
|
@ -56,8 +56,8 @@ paths:
|
|||
description: |-
|
||||
The room has been left.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
429:
|
||||
|
@ -93,8 +93,8 @@ paths:
|
|||
description: |-
|
||||
The room has been forgotten.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
429:
|
||||
|
|
|
@ -132,8 +132,7 @@ paths:
|
|||
An estimate on the total number of public rooms, if the
|
||||
server has an estimate.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"chunk": [
|
||||
{
|
||||
"aliases": ["#murrays:cheese.bar"],
|
||||
|
@ -198,8 +197,8 @@ paths:
|
|||
description: |-
|
||||
A string to search for in the room metadata, e.g. name,
|
||||
topic, canonical alias etc. (Optional).
|
||||
example: |-
|
||||
{"limit": 10, "filter": {"generic_search_term": "foo"}}
|
||||
example: {
|
||||
"limit": 10, "filter": {"generic_search_term": "foo"}}
|
||||
responses:
|
||||
200:
|
||||
description: A list of the rooms on the server.
|
||||
|
@ -279,8 +278,7 @@ paths:
|
|||
An estimate on the total number of public rooms, if the
|
||||
server has an estimate.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"chunk": [
|
||||
{
|
||||
"aliases": ["#murrays:cheese.bar"],
|
||||
|
|
|
@ -46,8 +46,7 @@ paths:
|
|||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"type": "m.login.password",
|
||||
"user": "cheeky_monkey",
|
||||
"password": "ilovebananas",
|
||||
|
@ -93,8 +92,7 @@ paths:
|
|||
200:
|
||||
description: The user has been authenticated.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"user_id": "@cheeky_monkey:matrix.org",
|
||||
"access_token": "abc123",
|
||||
"home_server": "matrix.org",
|
||||
|
@ -123,8 +121,7 @@ paths:
|
|||
description: |-
|
||||
Part of the request was invalid. For example, the login type may not be recognised.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_UNKNOWN",
|
||||
"error": "Bad login type."
|
||||
}
|
||||
|
@ -132,8 +129,8 @@ paths:
|
|||
description: |-
|
||||
The login attempt failed. For example, the password may have been incorrect.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"errcode": "M_FORBIDDEN"}
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN"}
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
|
|
|
@ -107,8 +107,7 @@ paths:
|
|||
type: object
|
||||
title: RoomEvent
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"start": "t47429-4392820_219380_26003_2265",
|
||||
"end": "t47409-4357353_219380_26003_2265",
|
||||
"chunk": [
|
||||
|
|
|
@ -62,8 +62,7 @@ paths:
|
|||
200:
|
||||
description: A batch of events is being returned
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"next_token": "abcdef",
|
||||
"notifications": [
|
||||
{
|
||||
|
|
|
@ -59,8 +59,7 @@ paths:
|
|||
200:
|
||||
description: "The events received, which may be none."
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"start": "s3456_9_0",
|
||||
"end": "s3457_9_0",
|
||||
"chunk": [
|
||||
|
@ -138,8 +137,7 @@ paths:
|
|||
200:
|
||||
description: The user's current state.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"end": "s3456_9_0",
|
||||
"presence": [
|
||||
{
|
||||
|
@ -421,8 +419,7 @@ paths:
|
|||
200:
|
||||
description: The full event.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"content": {
|
||||
"body": "Hello world!",
|
||||
"msgtype": "m.text"
|
||||
|
|
|
@ -69,8 +69,7 @@ paths:
|
|||
200:
|
||||
description: "The events received, which may be none."
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"start": "s3456_9_0",
|
||||
"end": "s3457_9_0",
|
||||
"chunk": [
|
||||
|
|
|
@ -50,8 +50,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"presence": "online",
|
||||
"status_msg": "I am here."
|
||||
}
|
||||
|
@ -68,8 +67,8 @@ paths:
|
|||
200:
|
||||
description: The new presence state was set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
429:
|
||||
|
@ -93,8 +92,7 @@ paths:
|
|||
200:
|
||||
description: The presence state for this user.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"presence": "unavailable",
|
||||
"last_active_ago": 420845
|
||||
}
|
||||
|
@ -143,8 +141,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"invite": [
|
||||
"@bob:matrix.org"
|
||||
],
|
||||
|
@ -169,8 +166,8 @@ paths:
|
|||
200:
|
||||
description: The list was updated.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
429:
|
||||
|
@ -194,8 +191,7 @@ paths:
|
|||
200:
|
||||
description: A list of presence events for this list.
|
||||
examples:
|
||||
application/json: |-
|
||||
[
|
||||
application/json: [
|
||||
{
|
||||
"content": {
|
||||
"last_active_ago": 395,
|
||||
|
|
|
@ -48,8 +48,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"displayname": "Alice Margatroid"
|
||||
}
|
||||
properties:
|
||||
|
@ -60,8 +59,8 @@ paths:
|
|||
200:
|
||||
description: The display name was set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
429:
|
||||
|
@ -87,8 +86,7 @@ paths:
|
|||
200:
|
||||
description: The display name for this user.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"displayname": "Alice Margatroid"
|
||||
}
|
||||
schema:
|
||||
|
@ -122,8 +120,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"avatar_url": "mxc://matrix.org/wefh34uihSDRGhw34"
|
||||
}
|
||||
properties:
|
||||
|
@ -134,8 +131,8 @@ paths:
|
|||
200:
|
||||
description: The avatar URL was set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
429:
|
||||
|
@ -161,8 +158,7 @@ paths:
|
|||
200:
|
||||
description: The avatar URL for this user.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"avatar_url": "mxc://matrix.org/SDGdghriugerRg"
|
||||
}
|
||||
schema:
|
||||
|
@ -194,8 +190,7 @@ paths:
|
|||
200:
|
||||
description: The avatar URL for this user.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"avatar_url": "mxc://matrix.org/SDGdghriugerRg",
|
||||
"displayname": "Alice Margatroid"
|
||||
}
|
||||
|
|
|
@ -38,8 +38,7 @@ paths:
|
|||
200:
|
||||
description: The pushers for this user
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"pushers": [
|
||||
{
|
||||
"pushkey": "Xp/MzCt8/9DcSNE9cuiaoT5Ac55job3TdLSSmtmYl4A=",
|
||||
|
@ -133,8 +132,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"lang": "en",
|
||||
"kind": "http",
|
||||
"app_display_name": "Mat Rix",
|
||||
|
@ -216,15 +214,14 @@ paths:
|
|||
200:
|
||||
description: The pusher was set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
400:
|
||||
description: One or more of the pusher values were invalid.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"error": "Missing parameters: lang, data",
|
||||
"errcode": "M_MISSING_PARAM"
|
||||
}
|
||||
|
|
|
@ -52,8 +52,7 @@ paths:
|
|||
"$ref": "definitions/push_ruleset.yaml"
|
||||
]
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"global": {
|
||||
"content": [
|
||||
{
|
||||
|
@ -279,8 +278,7 @@ paths:
|
|||
The specific push rule. This will also include keys specific to the
|
||||
rule itself such as the rule's ``actions`` and ``conditions`` if set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"actions": [
|
||||
"dont_notify"
|
||||
],
|
||||
|
@ -330,8 +328,8 @@ paths:
|
|||
200:
|
||||
description: The push rule was deleted.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
tags:
|
||||
|
@ -393,8 +391,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"pattern": "cake*lie",
|
||||
"actions": ["notify"]
|
||||
}
|
||||
|
@ -425,15 +422,14 @@ paths:
|
|||
200:
|
||||
description: The pusher was set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
400:
|
||||
description: There was a problem configuring this push rule.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"error": "before/after rule not found: someRuleId",
|
||||
"errcode": "M_UNKNOWN"
|
||||
}
|
||||
|
@ -480,8 +476,7 @@ paths:
|
|||
200:
|
||||
description: Whether the push rule is enabled.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"enabled": true
|
||||
}
|
||||
schema:
|
||||
|
@ -532,16 +527,15 @@ paths:
|
|||
type: boolean
|
||||
description: Whether the push rule is enabled or not.
|
||||
required: ["enabled"]
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"enabled": true
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: The push rule was enabled or disabled.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
tags:
|
||||
|
@ -581,8 +575,7 @@ paths:
|
|||
200:
|
||||
description: The actions for this push rule.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"actions": ["notify"]
|
||||
}
|
||||
schema:
|
||||
|
@ -640,16 +633,15 @@ paths:
|
|||
enum: ["notify", "dont_notify", "coalesce", "set_tweak"]
|
||||
# TODO: type: object e.g. {"set_sound":"beeroclock.wav"} :/
|
||||
required: ["actions"]
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"actions": ["notify"]
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: The actions for the push rule were set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
tags:
|
||||
|
|
|
@ -62,14 +62,14 @@ paths:
|
|||
server will automatically set the ``ts`` field.
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{}
|
||||
example: {
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: The receipt was sent.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
429:
|
||||
|
|
|
@ -66,8 +66,7 @@ paths:
|
|||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"reason": "Indecent material"
|
||||
}
|
||||
properties:
|
||||
|
@ -78,8 +77,7 @@ paths:
|
|||
200:
|
||||
description: "An ID for the redaction event."
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"event_id": "YUwQidLecu"
|
||||
}
|
||||
schema:
|
||||
|
|
|
@ -110,8 +110,7 @@ paths:
|
|||
200:
|
||||
description: The account has been registered.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"user_id": "@cheeky_monkey:matrix.org",
|
||||
"access_token": "abc123",
|
||||
"home_server": "matrix.org",
|
||||
|
@ -154,8 +153,7 @@ paths:
|
|||
them after authentication is completed if, for example, the requested user ID
|
||||
was registered whilst the client was performing authentication.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_USER_IN_USE",
|
||||
"error": "Desired user ID is already taken."
|
||||
}
|
||||
|
@ -210,7 +208,7 @@ paths:
|
|||
Note that this may be an email containing the validation token or it may be informing
|
||||
the user of an error.
|
||||
examples:
|
||||
application/json: "{}"
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
400:
|
||||
|
@ -225,8 +223,7 @@ paths:
|
|||
* ``M_SERVER_NOT_TRUSTED`` : The ``id_server`` parameter refers to an ID server
|
||||
that is not trusted by this Home Server.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"errcode": "M_THREEPID_IN_USE",
|
||||
"error": "The specified address is already in use"
|
||||
}
|
||||
|
@ -266,7 +263,7 @@ paths:
|
|||
200:
|
||||
description: The password has been changed.
|
||||
examples:
|
||||
application/json: "{}"
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
|
@ -331,7 +328,7 @@ paths:
|
|||
200:
|
||||
description: The account has been deactivated.
|
||||
examples:
|
||||
application/json: "{}"
|
||||
application/json: {}
|
||||
schema:
|
||||
type: object
|
||||
401:
|
||||
|
|
|
@ -37,8 +37,7 @@ paths:
|
|||
200:
|
||||
description: The current state of the room
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"membership": "join",
|
||||
"messages": {
|
||||
"chunk": [
|
||||
|
|
|
@ -66,8 +66,7 @@ paths:
|
|||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"msgtype": "m.text",
|
||||
"body": "hello"
|
||||
}
|
||||
|
@ -75,8 +74,7 @@ paths:
|
|||
200:
|
||||
description: "An ID for the sent event."
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"event_id": "YUwRidLecu"
|
||||
}
|
||||
schema:
|
||||
|
|
|
@ -67,8 +67,7 @@ paths:
|
|||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"membership": "join",
|
||||
"avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto",
|
||||
"displayname": "Alice Margatroid"
|
||||
|
@ -77,8 +76,7 @@ paths:
|
|||
200:
|
||||
description: "An ID for the sent event."
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"event_id": "YUwRidLecu"
|
||||
}
|
||||
schema:
|
||||
|
@ -125,16 +123,14 @@ paths:
|
|||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"name": "New name for the room"
|
||||
}
|
||||
responses:
|
||||
200:
|
||||
description: "An ID for the sent event."
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"event_id": "YUwRidLecu"
|
||||
}
|
||||
schema:
|
||||
|
|
|
@ -60,8 +60,8 @@ paths:
|
|||
200:
|
||||
description: The content of the state event.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"name": "Example room name"}
|
||||
application/json: {
|
||||
"name": "Example room name"}
|
||||
schema:
|
||||
type: object
|
||||
404:
|
||||
|
@ -101,8 +101,8 @@ paths:
|
|||
200:
|
||||
description: The content of the state event.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"name": "Example room name"}
|
||||
application/json: {
|
||||
"name": "Example room name"}
|
||||
schema:
|
||||
type: object
|
||||
404:
|
||||
|
@ -131,8 +131,7 @@ paths:
|
|||
200:
|
||||
description: The current state of the room
|
||||
examples:
|
||||
application/json: |-
|
||||
[
|
||||
application/json: [
|
||||
{
|
||||
"age": 7148266897,
|
||||
"content": {
|
||||
|
@ -249,8 +248,7 @@ paths:
|
|||
this will be the current members of the room. If you have left the
|
||||
room then this will be the members of the room when you left.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"chunk": [
|
||||
{
|
||||
"age": 6547561012,
|
||||
|
|
|
@ -46,8 +46,7 @@ paths:
|
|||
name: body
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"search_categories": {
|
||||
"room_events": {
|
||||
"keys": [
|
||||
|
@ -297,8 +296,7 @@ paths:
|
|||
the next call. If this field is absent, there are no
|
||||
more results.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"search_categories": {
|
||||
"room_events": {
|
||||
"groups": {
|
||||
|
|
|
@ -253,8 +253,7 @@ paths:
|
|||
Information on end-to-end device updates, as specified in
|
||||
|device_lists_sync|_.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"next_batch": "s72595_4483_1934",
|
||||
"presence": {
|
||||
"events": [
|
||||
|
|
|
@ -61,8 +61,7 @@ paths:
|
|||
title: Tags
|
||||
type: object
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"tags": {
|
||||
"work": {"order": "1"},
|
||||
"pinned": {}
|
||||
|
@ -107,8 +106,8 @@ paths:
|
|||
Extra data for the tag, e.g. ordering.
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{"order": "1"}
|
||||
example: {
|
||||
"order": "1"}
|
||||
responses:
|
||||
200:
|
||||
description:
|
||||
|
@ -116,8 +115,8 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
tags:
|
||||
- User data
|
||||
delete:
|
||||
|
@ -156,7 +155,7 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
tags:
|
||||
- User data
|
||||
|
|
|
@ -89,8 +89,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"id_server": "matrix.org",
|
||||
"medium": "email",
|
||||
"address": "cheeky@monkey.com"
|
||||
|
@ -111,8 +110,8 @@ paths:
|
|||
200:
|
||||
description: The user has been invited to join the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
403:
|
||||
|
@ -124,8 +123,8 @@ paths:
|
|||
- The inviter is not currently in the room.
|
||||
- The inviter's power level is insufficient to invite users to the room.
|
||||
examples:
|
||||
application/json: |-
|
||||
{"errcode": "M_FORBIDDEN", "error": "@cheeky_monkey:matrix.org is banned from the room"}
|
||||
application/json: {
|
||||
"errcode": "M_FORBIDDEN", "error": "@cheeky_monkey:matrix.org is banned from the room"}
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
|
|
|
@ -83,7 +83,7 @@ paths:
|
|||
description:
|
||||
The message was successfully sent.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
tags:
|
||||
- Send-to-Device messaging
|
||||
|
|
|
@ -56,8 +56,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"typing": true,
|
||||
"timeout": 30000
|
||||
}
|
||||
|
@ -75,8 +74,8 @@ paths:
|
|||
200:
|
||||
description: The new typing state was set.
|
||||
examples:
|
||||
application/json: |-
|
||||
{}
|
||||
application/json: {
|
||||
}
|
||||
schema:
|
||||
type: object # empty json object
|
||||
429:
|
||||
|
|
|
@ -37,8 +37,7 @@ paths:
|
|||
200:
|
||||
description: The versions supported by the server.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"versions": ["r0.0.1"]
|
||||
}
|
||||
schema:
|
||||
|
|
|
@ -39,8 +39,7 @@ paths:
|
|||
200:
|
||||
description: The TURN server credentials.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"username":"1443779631:@user:example.com",
|
||||
"password":"JlKfBy1QwLrO20385QyAtEyIv0=",
|
||||
"uris":[
|
||||
|
|
|
@ -45,8 +45,7 @@ paths:
|
|||
description:
|
||||
The association for that 3pid, or the empty object if no association is known.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"address": "louise@bobs.burgers",
|
||||
"medium": "email",
|
||||
"mxid": "@ears:matrix.org",
|
||||
|
|
|
@ -43,8 +43,7 @@ paths:
|
|||
description:
|
||||
The public key exists.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"public_key": "VXuGitF39UH5iRfvbIknlvlAVKgD1BsLDMvBf0pmp7c"
|
||||
}
|
||||
schema:
|
||||
|
@ -70,8 +69,7 @@ paths:
|
|||
description:
|
||||
The validity of the public key.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"valid": true
|
||||
}
|
||||
schema:
|
||||
|
@ -98,8 +96,7 @@ paths:
|
|||
description:
|
||||
The validity of the public key.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"valid": true
|
||||
}
|
||||
schema:
|
||||
|
|
|
@ -54,8 +54,7 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: object
|
||||
example: |-
|
||||
{
|
||||
example: {
|
||||
"notification": {
|
||||
"id": "$3957tyerfgewrf384",
|
||||
"room_id": "!slw48wfj34rtnrf:example.com",
|
||||
|
@ -207,8 +206,7 @@ paths:
|
|||
200:
|
||||
description: A list of rejected push keys.
|
||||
examples:
|
||||
application/json: |-
|
||||
{
|
||||
application/json: {
|
||||
"rejected": [ "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/" ]
|
||||
}
|
||||
schema:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue