Error response examples, cribbed from Synapse

This commit is contained in:
David Robertson 2022-07-01 00:15:53 +01:00
parent f721128371
commit bd2ccfa91e
No known key found for this signature in database
GPG key ID: 903ECE108A39DEDD

View file

@ -74,15 +74,30 @@ paths:
400:
description: |-
The request body is not a JSON object.
examples:
application/json: {
"errcode": "M_BAD_JSON",
"error": "Content must be a JSON object."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
403:
description: |-
The access token provided is not authorized to modify this user's account
data.
examples:
application/json: {
"errcode": "M_FORBIDDEN",
"error": "Cannot add account data for other users."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
405:
examples:
application/json: {
"errcode": "M_BAD_JSON",
"error": "Cannot set m.fully_read through this API."
}
description: |-
This `type` of account data is controlled by the server; it cannot be
modified by clients.
@ -127,11 +142,21 @@ paths:
description: |-
The access token provided is not authorized to retrieve this user's account
data.
examples:
application/json: {
"errcode": "M_FORBIDDEN",
"error": "Cannot add account data for other users."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
404:
description: |-
No account data has been provided for this user with the given `type`.
examples:
application/json: {
"errcode": "M_NOT_FOUND",
"error": "Room account data not found."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
tags:
@ -190,18 +215,33 @@ paths:
400:
description: |-
The request body is not a JSON object.
examples:
application/json: {
"errcode": "M_BAD_JSON",
"error": "Content must be a JSON object."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
403:
description: |-
The access token provided is not authorized to modify this user's account
data.
examples:
application/json: {
"errcode": "M_FORBIDDEN",
"error": "Cannot add account data for other users."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
405:
description: |-
This `type` of account data is controlled by the server; it cannot be
modified by clients.
examples:
application/json: {
"errcode": "M_BAD_JSON",
"error": "Cannot set m.fully_read through this API."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
tags:
@ -250,12 +290,22 @@ paths:
description: |-
The access token provided is not authorized to retrieve this user's account
data.
examples:
application/json: {
"errcode": "M_FORBIDDEN",
"error": "Cannot add account data for other users."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
404:
description: |-
No account data has been provided for this user and this room with the
given `type`.
examples:
application/json: {
"errcode": "M_NOT_FOUND",
"error": "Room account data not found."
}
schema:
$ref: "../client-server/definitions/errors/error.yaml"
tags: