From bed9223610d069021a612fecce2cadbcce6616a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 4 Jul 2023 20:32:47 +0200 Subject: [PATCH] Make sure examples types match schema in definitions (#1563) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make sure examples types match schema in definitions Signed-off-by: Kévin Commaille * Add changelogs Signed-off-by: Kévin Commaille * Add double quotes around URL Signed-off-by: Kévin Commaille --------- Signed-off-by: Kévin Commaille --- changelogs/client_server/newsfragments/1563.clarification | 1 + .../identity_service/newsfragments/1563.clarification | 1 + changelogs/server_server/newsfragments/1563.clarification | 1 + data/api/client-server/message_pagination.yaml | 2 +- data/api/client-server/old_sync.yaml | 6 +++--- data/api/client-server/peeking_events.yaml | 5 ++--- data/api/client-server/pushrules.yaml | 2 +- data/api/client-server/sync.yaml | 2 +- data/api/identity/v2_associations.yaml | 2 +- data/api/identity/v2_email_associations.yaml | 2 +- data/api/identity/v2_phone_associations.yaml | 2 +- data/api/identity/v2_terms.yaml | 2 +- data/api/server-server/leaving-v2.yaml | 4 ++-- 13 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1563.clarification create mode 100644 changelogs/identity_service/newsfragments/1563.clarification create mode 100644 changelogs/server_server/newsfragments/1563.clarification diff --git a/changelogs/client_server/newsfragments/1563.clarification b/changelogs/client_server/newsfragments/1563.clarification new file mode 100644 index 000000000..1d6ef324a --- /dev/null +++ b/changelogs/client_server/newsfragments/1563.clarification @@ -0,0 +1 @@ +Make sure examples types match schema in definitions. diff --git a/changelogs/identity_service/newsfragments/1563.clarification b/changelogs/identity_service/newsfragments/1563.clarification new file mode 100644 index 000000000..1d6ef324a --- /dev/null +++ b/changelogs/identity_service/newsfragments/1563.clarification @@ -0,0 +1 @@ +Make sure examples types match schema in definitions. diff --git a/changelogs/server_server/newsfragments/1563.clarification b/changelogs/server_server/newsfragments/1563.clarification new file mode 100644 index 000000000..1d6ef324a --- /dev/null +++ b/changelogs/server_server/newsfragments/1563.clarification @@ -0,0 +1 @@ +Make sure examples types match schema in definitions. diff --git a/data/api/client-server/message_pagination.yaml b/data/api/client-server/message_pagination.yaml index 940b98027..07c16497b 100644 --- a/data/api/client-server/message_pagination.yaml +++ b/data/api/client-server/message_pagination.yaml @@ -84,7 +84,7 @@ paths: - in: query name: limit description: "The maximum number of events to return. Default: 10." - example: "3" + example: 3 schema: type: integer - in: query diff --git a/data/api/client-server/old_sync.yaml b/data/api/client-server/old_sync.yaml index 3e0ad0b65..540c97c78 100644 --- a/data/api/client-server/old_sync.yaml +++ b/data/api/client-server/old_sync.yaml @@ -44,7 +44,7 @@ paths: name: timeout description: The maximum time in milliseconds to wait for an event. required: false - example: "35000" + example: 35000 schema: type: integer responses: @@ -105,7 +105,7 @@ paths: name: limit description: The maximum number of messages to return for each room. required: false - example: "2" + example: 2 schema: type: integer - in: query @@ -116,7 +116,7 @@ paths: included. If set to `true` then rooms that the user has left are included as well. By default this is `false`. required: false - example: "true" + example: true schema: type: boolean responses: diff --git a/data/api/client-server/peeking_events.yaml b/data/api/client-server/peeking_events.yaml index 19eb67a02..b323d940b 100644 --- a/data/api/client-server/peeking_events.yaml +++ b/data/api/client-server/peeking_events.yaml @@ -49,14 +49,13 @@ paths: name: timeout description: The maximum time in milliseconds to wait for an event. required: false - example: "35000" + example: 35000 schema: type: integer - in: query name: room_id description: The room ID for which events should be returned. - example: - - "!somewhere:over.the.rainbow" + example: "!somewhere:over.the.rainbow" schema: type: string responses: diff --git a/data/api/client-server/pushrules.yaml b/data/api/client-server/pushrules.yaml index 880133079..57638583e 100644 --- a/data/api/client-server/pushrules.yaml +++ b/data/api/client-server/pushrules.yaml @@ -543,7 +543,7 @@ paths: required: true description: | The kind of rule - example: cake + example: content schema: type: string enum: diff --git a/data/api/client-server/sync.yaml b/data/api/client-server/sync.yaml index 0b22a96e4..5e5547222 100644 --- a/data/api/client-server/sync.yaml +++ b/data/api/client-server/sync.yaml @@ -84,7 +84,7 @@ paths: changed since the point indicated by `since` will be returned. By default, this is `false`. - example: "false" + example: false schema: type: boolean - in: query diff --git a/data/api/identity/v2_associations.yaml b/data/api/identity/v2_associations.yaml index 8ed4041aa..c9b8ba6e0 100644 --- a/data/api/identity/v2_associations.yaml +++ b/data/api/identity/v2_associations.yaml @@ -29,7 +29,7 @@ paths: name: sid description: The Session ID generated by the `requestToken` call. required: true - example: 1234 + example: "1234" schema: type: string - in: query diff --git a/data/api/identity/v2_email_associations.yaml b/data/api/identity/v2_email_associations.yaml index 0bd31b529..ad5c25178 100644 --- a/data/api/identity/v2_email_associations.yaml +++ b/data/api/identity/v2_email_associations.yaml @@ -186,7 +186,7 @@ paths: name: sid required: true description: The session ID, generated by the `requestToken` call. - example: 1234 + example: "1234" schema: type: string - in: query diff --git a/data/api/identity/v2_phone_associations.yaml b/data/api/identity/v2_phone_associations.yaml index f887be263..7f44fb3d4 100644 --- a/data/api/identity/v2_phone_associations.yaml +++ b/data/api/identity/v2_phone_associations.yaml @@ -188,7 +188,7 @@ paths: name: sid required: true description: The session ID, generated by the `requestToken` call. - example: 1234 + example: "1234" schema: type: string - in: query diff --git a/data/api/identity/v2_terms.yaml b/data/api/identity/v2_terms.yaml index f4a459324..550d0bdb5 100644 --- a/data/api/identity/v2_terms.yaml +++ b/data/api/identity/v2_terms.yaml @@ -131,7 +131,7 @@ paths: items: type: string description: The URLs the user is accepting in this request. - example: https://example.org/somewhere/terms-2.0-en.html + example: ["https://example.org/somewhere/terms-2.0-en.html"] required: - user_accepts responses: diff --git a/data/api/server-server/leaving-v2.yaml b/data/api/server-server/leaving-v2.yaml index 75248b535..b79ce0083 100644 --- a/data/api/server-server/leaving-v2.yaml +++ b/data/api/server-server/leaving-v2.yaml @@ -109,7 +109,6 @@ paths: - depth - content example: { - "room_id": "!somewhere:example.org", "type": "m.room.member", "state_key": "@someone:example.org", "origin": "example.org", @@ -117,7 +116,8 @@ paths: "sender": "@someone:example.org", "content": { "membership": "leave" - } + }, + "depth": 0 } required: true responses: