From 9f45914196031876102776272413dd7bb992acd3 Mon Sep 17 00:00:00 2001 From: Suyash Vardhan Mathur Date: Thu, 1 Jul 2021 03:02:19 +0530 Subject: [PATCH] openapi: Fix fixture rendering in rest-error-handling. The fixtures are now rendered differently, and using just 400 in fixture renders all the 400 fixtures with descriptions, whereas 400_1 and 400_0 are invalid now. This commit removes the hardcoded descriptions, and fixes the fixture rendering. --- templates/zerver/api/rest-error-handling.md | 38 ++------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/templates/zerver/api/rest-error-handling.md b/templates/zerver/api/rest-error-handling.md index 0364a2f770..b68db96c3e 100644 --- a/templates/zerver/api/rest-error-handling.md +++ b/templates/zerver/api/rest-error-handling.md @@ -17,24 +17,9 @@ translated into French if the user has a French locale). Each endpoint documents its own unique errors; below, we document errors common to many endpoints: -## Invalid API key +{generate_code_example|/rest-error-handling:post|fixture(400)} -A typical failed JSON response for when the API key is invalid: - -{generate_code_example|/rest-error-handling:post|fixture(400_0)} - -## Missing request parameter(s) - -A typical failed JSON response for when a required request parameter -is not supplied: - -{generate_code_example|/rest-error-handling:post|fixture(400_1)} - -## Rate limit exceeded - -A typical failed JSON response for when a rate limit is exceeded: - -{generate_code_example|/rest-error-handling:post|fixture(429_0)} +{generate_code_example|/rest-error-handling:post|fixture(429)} The `retry-after` paremeter in the response indicates how many seconds the client must wait before making additional requests. @@ -62,21 +47,4 @@ When the Zulip server has configured multiple rate limits that apply to a given request, the values returned will be for the strictest limit. -## User not authorized for query - -A typical failed JSON response for when the user is not authorized for -a query: - -{generate_code_example|/rest-error-handling:post|fixture(400_2)} - -## User account deactivated - -A typical failed json response for when user's account is deactivated: - -{generate_code_example|/rest-error-handling:post|fixture(403_0)} - -## Realm deactivated - -A typical failed json response for when user's organization is deactivated: - -{generate_code_example|/rest-error-handling:post|fixture(403_1)} +{generate_code_example|/rest-error-handling:post|fixture(403)}