From 28a2893a41875bdefaec74cda2cac985bbccd52c Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Fri, 1 Sep 2023 17:30:57 +0200 Subject: [PATCH] api-docs: Update mute/unmute user error documentation for 'code' fields. --- zerver/openapi/zulip.yaml | 47 ++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 5046ff2684..1f5284142a 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -9160,19 +9160,34 @@ paths: schema: oneOf: - allOf: - - $ref: "#/components/schemas/JsonError" - - example: {"msg": "Cannot mute self", "result": "error"} + - $ref: "#/components/schemas/CodedError" + - example: + { + "code": "BAD_REQUEST", + "msg": "Cannot mute self", + "result": "error", + } description: | - An example JSON response for when the user is yourself: + An example JSON response for when the user ID is the current + user's ID: - allOf: - - $ref: "#/components/schemas/JsonError" - - example: {"msg": "No such user", "result": "error"} + - $ref: "#/components/schemas/CodedError" + - example: + { + "code": "BAD_REQUEST", + "msg": "No such user", + "result": "error", + } description: | An example JSON response for when the user is nonexistent or inaccessible: - allOf: - - $ref: "#/components/schemas/JsonError" + - $ref: "#/components/schemas/CodedError" - example: - {"msg": "User already muted", "result": "error"} + { + "code": "BAD_REQUEST", + "msg": "User already muted", + "result": "error", + } description: | An example JSON response for when the user is already muted: delete: @@ -9196,13 +9211,23 @@ paths: schema: oneOf: - allOf: - - $ref: "#/components/schemas/JsonError" - - example: {"msg": "No such user", "result": "error"} + - $ref: "#/components/schemas/CodedError" + - example: + { + "code": "BAD_REQUEST", + "msg": "No such user", + "result": "error", + } description: | An example JSON response for when the user is nonexistent or inaccessible: - allOf: - - $ref: "#/components/schemas/JsonError" - - example: {"msg": "User is not muted", "result": "error"} + - $ref: "#/components/schemas/CodedError" + - example: + { + "code": "BAD_REQUEST", + "msg": "User is not muted", + "result": "error", + } description: | An example JSON response for when the user is not previously muted: