Responses schema fixes (#3650)

Fixes #2237.

Corrects the response schemas for:

```
PUT /user/{user_id}/account_data/{account_dataType}
PUT /user/{user_id}/rooms/{roomId}/account_data/{type}
PUT /directory/list/room/{roomId}
PUT /sendToDevice/{eventType}/{txnId}
POST /account/3pid
POST /account/3pid/add
POST /account/3pid/bind
```
This commit is contained in:
Alexandre Franke 2022-01-31 11:31:29 +01:00 committed by GitHub
parent 2e5cc42666
commit d3e39567f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 26 deletions

View file

@ -0,0 +1 @@
Correct the schema for the responses for various API endpoints.

View file

@ -67,6 +67,10 @@ paths:
200: 200:
description: description:
The account_data was successfully added. The account_data was successfully added.
examples:
application/json: {}
schema:
type: object
tags: tags:
- User data - User data
get: get:
@ -151,6 +155,10 @@ paths:
200: 200:
description: description:
The account_data was successfully added. The account_data was successfully added.
examples:
application/json: {}
schema:
type: object
tags: tags:
- User data - User data
get: get:

View file

@ -149,26 +149,26 @@ paths:
application/json: { application/json: {
"submit_url": "https://example.org/path/to/submitToken" "submit_url": "https://example.org/path/to/submitToken"
} }
schema: schema:
type: object type: object
properties: properties:
submit_url: submit_url:
type: string type: string
format: uri format: uri
description: |- description: |-
An optional field containing a URL where the client must An optional field containing a URL where the client must
submit the validation token to, with identical parameters submit the validation token to, with identical parameters
to the Identity Service API's `POST to the Identity Service API's `POST
/validate/email/submitToken` endpoint (without the requirement /validate/email/submitToken` endpoint (without the requirement
for an access token). The homeserver must send this token to the for an access token). The homeserver must send this token to the
user (if applicable), who should then be prompted to provide it user (if applicable), who should then be prompted to provide it
to the client. to the client.
If this field is not present, the client can assume that If this field is not present, the client can assume that
verification will happen without the client's involvement verification will happen without the client's involvement
provided the homeserver advertises this specification version provided the homeserver advertises this specification version
in the `/versions` response (ie: r0.5.0). in the `/versions` response (ie: r0.5.0).
example: "https://example.org/path/to/submitToken" example: "https://example.org/path/to/submitToken"
403: 403:
description: The credentials could not be verified with the identity server. description: The credentials could not be verified with the identity server.
examples: examples:
@ -223,8 +223,8 @@ paths:
description: The addition was successful. description: The addition was successful.
examples: examples:
application/json: {} application/json: {}
schema: schema:
type: object type: object
401: 401:
description: |- description: |-
The homeserver requires additional authentication information. The homeserver requires additional authentication information.
@ -282,8 +282,8 @@ paths:
description: The addition was successful. description: The addition was successful.
examples: examples:
application/json: {} application/json: {}
schema: schema:
type: object type: object
429: 429:
description: This request was rate-limited. description: This request was rate-limited.
schema: schema:

View file

@ -298,9 +298,10 @@ paths:
responses: responses:
200: 200:
description: The update succeeded. description: The update succeeded.
examples:
application/json: {}
schema: schema:
type: object type: object
properties: {}
400: 400:
description: |- description: |-
A parameter was incorrect. For example, the `algorithm` does not A parameter was incorrect. For example, the `algorithm` does not

View file

@ -104,6 +104,8 @@ paths:
description: The visibility was updated, or no change was needed. description: The visibility was updated, or no change was needed.
examples: examples:
application/json: {} application/json: {}
schema:
type: object
404: 404:
description: The room is not known to the server description: The room is not known to the server
examples: examples:

View file

@ -85,7 +85,8 @@ paths:
description: description:
The message was successfully sent. The message was successfully sent.
examples: examples:
application/json: { application/json: {}
} schema:
type: object
tags: tags:
- Send-to-Device messaging - Send-to-Device messaging