From 1fa82c2fcda40c19d7f112bcdf446a516ecda320 Mon Sep 17 00:00:00 2001 From: Suyash Vardhan Mathur Date: Tue, 8 Jun 2021 02:23:29 +0530 Subject: [PATCH] apidocs: Fix response in API templates. Now, the descriptions and all subschemas are directly returned just by `generate_code_example`, and so, these individual subschemas and descriptions can be removed from the templates. All API endpoints docs are exactly the same after the change, except few where missing 400 responses got added due to the modification --- templates/zerver/api/add-code-playground.md | 4 ++-- templates/zerver/api/add-linkifier.md | 4 ++-- templates/zerver/api/add-reaction.md | 4 ++-- templates/zerver/api/archive-stream.md | 4 ---- .../zerver/api/check-messages-match-narrow.md | 4 ++-- .../zerver/api/create-custom-profile-field.md | 4 ++-- templates/zerver/api/create-user-group.md | 4 ---- templates/zerver/api/create-user.md | 5 ----- templates/zerver/api/deactivate-own-user.md | 5 ----- templates/zerver/api/deactivate-user.md | 5 ----- templates/zerver/api/delete-message.md | 11 +--------- templates/zerver/api/delete-queue.md | 5 ----- templates/zerver/api/dev-fetch-api-key.md | 4 ++-- templates/zerver/api/fetch-api-key.md | 2 -- templates/zerver/api/get-attachments.md | 4 ++-- templates/zerver/api/get-custom-emoji.md | 4 ++-- .../zerver/api/get-custom-profile-fields.md | 4 ++-- templates/zerver/api/get-events.md | 5 ----- templates/zerver/api/get-linkifiers.md | 4 ++-- templates/zerver/api/get-message-history.md | 4 ---- templates/zerver/api/get-messages.md | 6 +----- templates/zerver/api/get-own-user.md | 4 ++-- templates/zerver/api/get-raw-message.md | 6 ------ templates/zerver/api/get-server-settings.md | 4 ++-- templates/zerver/api/get-stream-id.md | 4 ---- templates/zerver/api/get-stream-topics.md | 5 ----- templates/zerver/api/get-streams.md | 6 ------ .../zerver/api/get-subscription-status.md | 4 ++-- templates/zerver/api/get-subscriptions.md | 4 ++-- templates/zerver/api/get-user-by-email.md | 4 ++-- templates/zerver/api/get-user-groups.md | 4 ++-- templates/zerver/api/get-user-presence.md | 4 ++-- templates/zerver/api/get-user.md | 4 ++-- templates/zerver/api/get-users.md | 4 ++-- templates/zerver/api/mark-all-as-read.md | 10 ++++------ templates/zerver/api/mute-topic.md | 13 +----------- templates/zerver/api/mute-user.md | 15 +------------- templates/zerver/api/reactivate-user.md | 4 ++-- templates/zerver/api/register-queue.md | 2 -- .../zerver/api/remove-code-playground.md | 4 ++-- templates/zerver/api/remove-linkifier.md | 4 ++-- templates/zerver/api/remove-reaction.md | 4 ++-- templates/zerver/api/remove-user-group.md | 4 ---- templates/zerver/api/render-message.md | 4 ++-- .../api/reorder-custom-profile-fields.md | 4 ++-- templates/zerver/api/send-message.md | 11 +--------- templates/zerver/api/set-typing-status.md | 4 ++-- templates/zerver/api/subscribe.md | 20 ++----------------- templates/zerver/api/unmute-user.md | 10 +--------- templates/zerver/api/unsubscribe.md | 4 ---- .../zerver/api/update-display-settings.md | 4 ++-- templates/zerver/api/update-linkifier.md | 4 ++-- templates/zerver/api/update-message-flags.md | 4 ++-- templates/zerver/api/update-message.md | 5 ----- .../api/update-notification-settings.md | 4 ++-- templates/zerver/api/update-stream.md | 4 ---- .../api/update-subscription-settings.md | 4 ++-- .../zerver/api/update-user-group-members.md | 4 ++-- templates/zerver/api/update-user-group.md | 4 ---- templates/zerver/api/update-user.md | 4 ---- templates/zerver/api/upload-custom-emoji.md | 4 ++-- templates/zerver/api/upload-file.md | 4 ++-- 62 files changed, 80 insertions(+), 239 deletions(-) diff --git a/templates/zerver/api/add-code-playground.md b/templates/zerver/api/add-code-playground.md index 8abd918b9a..152800a03e 100644 --- a/templates/zerver/api/add-code-playground.md +++ b/templates/zerver/api/add-code-playground.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/playgrounds:post|fixture(200)} + +{generate_code_example|/realm/playgrounds:post|fixture(400)} diff --git a/templates/zerver/api/add-linkifier.md b/templates/zerver/api/add-linkifier.md index 5900a92b42..ca2cd15016 100644 --- a/templates/zerver/api/add-linkifier.md +++ b/templates/zerver/api/add-linkifier.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/filters:post|fixture(200)} + +{generate_code_example|/realm/filters:post|fixture(400)} diff --git a/templates/zerver/api/add-reaction.md b/templates/zerver/api/add-reaction.md index 1278493335..235609a490 100644 --- a/templates/zerver/api/add-reaction.md +++ b/templates/zerver/api/add-reaction.md @@ -24,6 +24,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/{message_id}/reactions:post|fixture(200)} + +{generate_code_example|/messages/{message_id}/reactions:post|fixture(400)} diff --git a/templates/zerver/api/archive-stream.md b/templates/zerver/api/archive-stream.md index 493110041d..a0942f02e4 100644 --- a/templates/zerver/api/archive-stream.md +++ b/templates/zerver/api/archive-stream.md @@ -25,10 +25,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/streams/{stream_id}:delete|fixture(200)} -An example JSON response for when the supplied stream does not exist: - {generate_code_example|/streams/{stream_id}:delete|fixture(400)} diff --git a/templates/zerver/api/check-messages-match-narrow.md b/templates/zerver/api/check-messages-match-narrow.md index d44fa656a5..bc84648e13 100644 --- a/templates/zerver/api/check-messages-match-narrow.md +++ b/templates/zerver/api/check-messages-match-narrow.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/matches_narrow:get|fixture(200)} + +{generate_code_example|/messages/matches_narrow:get|fixture(400)} diff --git a/templates/zerver/api/create-custom-profile-field.md b/templates/zerver/api/create-custom-profile-field.md index 56df272b5d..ddaacb2cad 100644 --- a/templates/zerver/api/create-custom-profile-field.md +++ b/templates/zerver/api/create-custom-profile-field.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/profile_fields:post|fixture(200)} + +{generate_code_example|/realm/profile_fields:post|fixture(400)} diff --git a/templates/zerver/api/create-user-group.md b/templates/zerver/api/create-user-group.md index c86fe7f492..8024e7d035 100644 --- a/templates/zerver/api/create-user-group.md +++ b/templates/zerver/api/create-user-group.md @@ -23,10 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/user_groups/create:post|fixture(200)} -An example JSON error response for when the one of the users does not exist: - {generate_code_example|/user_groups/create:post|fixture(400)} diff --git a/templates/zerver/api/create-user.md b/templates/zerver/api/create-user.md index 6473c57247..3c0c99c69c 100644 --- a/templates/zerver/api/create-user.md +++ b/templates/zerver/api/create-user.md @@ -33,11 +33,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users:post|fixture(200)} -A typical JSON response for when another user with the same -email address already exists in the realm: - {generate_code_example|/users:post|fixture(400)} diff --git a/templates/zerver/api/deactivate-own-user.md b/templates/zerver/api/deactivate-own-user.md index 845a5b4a16..5bec4b1cb8 100644 --- a/templates/zerver/api/deactivate-own-user.md +++ b/templates/zerver/api/deactivate-own-user.md @@ -23,11 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me:delete|fixture(200)} -An example JSON error response when attempting to deactivate the only -organization owner in an organization: - {generate_code_example|/users/me:delete|fixture(400)} diff --git a/templates/zerver/api/deactivate-user.md b/templates/zerver/api/deactivate-user.md index 5fdaa44cc1..8f3acf18d5 100644 --- a/templates/zerver/api/deactivate-user.md +++ b/templates/zerver/api/deactivate-user.md @@ -23,11 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/{user_id}:delete|fixture(200)} -An example JSON error response when attempting to deactivate the only -organization owner in an organization: - {generate_code_example|/users/{user_id}:delete|fixture(400)} diff --git a/templates/zerver/api/delete-message.md b/templates/zerver/api/delete-message.md index e1f8c12aee..657ed79b20 100644 --- a/templates/zerver/api/delete-message.md +++ b/templates/zerver/api/delete-message.md @@ -25,15 +25,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/{message_id}:delete|fixture(200)} -An example JSON response for when the specified message does not exist: - -{generate_code_example|/messages/{message_id}:delete|fixture(400_0)} - -An example JSON response for when the user making the query does not -have permission to delete the message: - -{generate_code_example|/messages/{message_id}:delete|fixture(400_1)} +{generate_code_example|/messages/{message_id}:delete|fixture(400)} diff --git a/templates/zerver/api/delete-queue.md b/templates/zerver/api/delete-queue.md index 5bc7779793..5531f86c43 100644 --- a/templates/zerver/api/delete-queue.md +++ b/templates/zerver/api/delete-queue.md @@ -29,11 +29,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/events:delete|fixture(200)} -A typical JSON response for when the `queue_id` is non-existent or the -associated queue has already been deleted: - {generate_code_example|/events:delete|fixture(400)} diff --git a/templates/zerver/api/dev-fetch-api-key.md b/templates/zerver/api/dev-fetch-api-key.md index 47e4f701b0..fed4da23dc 100644 --- a/templates/zerver/api/dev-fetch-api-key.md +++ b/templates/zerver/api/dev-fetch-api-key.md @@ -23,6 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/dev_fetch_api_key:post|fixture(200)} + +{generate_code_example|/dev_fetch_api_key:post|fixture(400)} diff --git a/templates/zerver/api/fetch-api-key.md b/templates/zerver/api/fetch-api-key.md index 7dd21ada3f..8f62622cdf 100644 --- a/templates/zerver/api/fetch-api-key.md +++ b/templates/zerver/api/fetch-api-key.md @@ -23,6 +23,4 @@ ### Example response -A typical successful JSON response may look like: - {generate_code_example|/fetch_api_key:post|fixture(200)} diff --git a/templates/zerver/api/get-attachments.md b/templates/zerver/api/get-attachments.md index 69047d1ab1..2f5b6da32d 100644 --- a/templates/zerver/api/get-attachments.md +++ b/templates/zerver/api/get-attachments.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/attachments:get|fixture(200)} + +{generate_code_example|/attachments:get|fixture(400)} diff --git a/templates/zerver/api/get-custom-emoji.md b/templates/zerver/api/get-custom-emoji.md index 11c1befdcd..97e607b407 100644 --- a/templates/zerver/api/get-custom-emoji.md +++ b/templates/zerver/api/get-custom-emoji.md @@ -34,6 +34,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/emoji:get|fixture(200)} + +{generate_code_example|/realm/emoji:get|fixture(400)} diff --git a/templates/zerver/api/get-custom-profile-fields.md b/templates/zerver/api/get-custom-profile-fields.md index f4677119e6..e3ce7fbdb8 100644 --- a/templates/zerver/api/get-custom-profile-fields.md +++ b/templates/zerver/api/get-custom-profile-fields.md @@ -28,6 +28,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/profile_fields:get|fixture(200)} + +{generate_code_example|/realm/profile_fields:get|fixture(400)} diff --git a/templates/zerver/api/get-events.md b/templates/zerver/api/get-events.md index e13cbdbf85..054d94df56 100644 --- a/templates/zerver/api/get-events.md +++ b/templates/zerver/api/get-events.md @@ -58,15 +58,10 @@ endpoint and a queue would be registered in the absence of a `queue_id`. #### Example response -A typical successful JSON response may look like: - {generate_code_example|/events:get|fixture(200)} #### BAD_EVENT_QUEUE_ID errors -If the target event queue has been garbage collected, you'll get the -following error response: - {generate_code_example|/events:get|fixture(400)} A compliant client will handle this error by re-initializing itself diff --git a/templates/zerver/api/get-linkifiers.md b/templates/zerver/api/get-linkifiers.md index 6145115e76..06a479ed74 100644 --- a/templates/zerver/api/get-linkifiers.md +++ b/templates/zerver/api/get-linkifiers.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/linkifiers:get|fixture(200)} + +{generate_code_example|/realm/linkifiers:get|fixture(400)} diff --git a/templates/zerver/api/get-message-history.md b/templates/zerver/api/get-message-history.md index d38683f8bc..bac6bf337e 100644 --- a/templates/zerver/api/get-message-history.md +++ b/templates/zerver/api/get-message-history.md @@ -37,10 +37,6 @@ was edited, `prev_content`, `prev_rendered_content`, and #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/{message_id}/history:get|fixture(200)} -An example JSON response for when the specified message does not exist: - {generate_code_example|/messages/{message_id}/history:get|fixture(400)} diff --git a/templates/zerver/api/get-messages.md b/templates/zerver/api/get-messages.md index 7c16ea543a..d035ecbb9d 100644 --- a/templates/zerver/api/get-messages.md +++ b/templates/zerver/api/get-messages.md @@ -37,10 +37,6 @@ present in all Zulip API responses). #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages:get|fixture(200)} -[status-messages]: /help/format-your-message-using-markdown#status-messages -[linkifiers]: /help/add-a-custom-linkifier -[message-flags]: /api/update-message-flags#available-flags +{generate_code_example|/messages:get|fixture(400)} diff --git a/templates/zerver/api/get-own-user.md b/templates/zerver/api/get-own-user.md index 642e1eda21..ec4ecce0af 100644 --- a/templates/zerver/api/get-own-user.md +++ b/templates/zerver/api/get-own-user.md @@ -33,6 +33,6 @@ This endpoint takes no parameters. #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me:get|fixture(200)} + +{generate_code_example|/users/me:get|fixture(400)} diff --git a/templates/zerver/api/get-raw-message.md b/templates/zerver/api/get-raw-message.md index 635542d135..b1580a9aa0 100644 --- a/templates/zerver/api/get-raw-message.md +++ b/templates/zerver/api/get-raw-message.md @@ -27,12 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/{message_id}:get|fixture(200)} -An example JSON response for when the specified message does not exist or it -is not visible to the user making the query (e.g. it was a PM between other -two users): - {generate_code_example|/messages/{message_id}:get|fixture(400)} diff --git a/templates/zerver/api/get-server-settings.md b/templates/zerver/api/get-server-settings.md index 21fa7bf02b..7f264a9640 100644 --- a/templates/zerver/api/get-server-settings.md +++ b/templates/zerver/api/get-server-settings.md @@ -39,6 +39,6 @@ response, for two reasons: #### Example response -A typical successful JSON response for a single-organization server may look like: - {generate_code_example|/server_settings:get|fixture(200)} + +{generate_code_example|/server_settings:get|fixture(400)} diff --git a/templates/zerver/api/get-stream-id.md b/templates/zerver/api/get-stream-id.md index 0288e64c05..2cf59325b4 100644 --- a/templates/zerver/api/get-stream-id.md +++ b/templates/zerver/api/get-stream-id.md @@ -35,10 +35,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/get_stream_id:get|fixture(200)} -An example JSON response for when the supplied stream does not exist: - {generate_code_example|/get_stream_id:get|fixture(400)} diff --git a/templates/zerver/api/get-stream-topics.md b/templates/zerver/api/get-stream-topics.md index 6f9352786e..4aa7514260 100644 --- a/templates/zerver/api/get-stream-topics.md +++ b/templates/zerver/api/get-stream-topics.md @@ -33,11 +33,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me/{stream_id}/topics:get|fixture(200)} -An example JSON response for when the user is attempting to fetch the topics -of a non-existing stream (or also a private stream they don't have access to): - {generate_code_example|/users/me/{stream_id}/topics:get|fixture(400)} diff --git a/templates/zerver/api/get-streams.md b/templates/zerver/api/get-streams.md index 6b24e95176..5dfab8a24f 100644 --- a/templates/zerver/api/get-streams.md +++ b/templates/zerver/api/get-streams.md @@ -40,12 +40,6 @@ as URL query parameters, like so: #### Example response -A typical successful JSON response may look like: - {generate_code_example|/streams:get|fixture(200)} -An example JSON response for when the user is not authorized to use the -`include_all_active` parameter (i.e. because they are not an organization -administrator): - {generate_code_example|/streams:get|fixture(400)} diff --git a/templates/zerver/api/get-subscription-status.md b/templates/zerver/api/get-subscription-status.md index 88e98f061c..ff417aa5d5 100644 --- a/templates/zerver/api/get-subscription-status.md +++ b/templates/zerver/api/get-subscription-status.md @@ -23,6 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/{user_id}/subscriptions/{stream_id}:get|fixture(200)} + +{generate_code_example|/users/{user_id}/subscriptions/{stream_id}:get|fixture(400)} diff --git a/templates/zerver/api/get-subscriptions.md b/templates/zerver/api/get-subscriptions.md index 997acf7ced..f4c972a4c2 100644 --- a/templates/zerver/api/get-subscriptions.md +++ b/templates/zerver/api/get-subscriptions.md @@ -37,6 +37,6 @@ You may pass the `include_subscribers` query parameter as follows: #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me/subscriptions:get|fixture(200)} + +{generate_code_example|/users/me/subscriptions:get|fixture(400)} diff --git a/templates/zerver/api/get-user-by-email.md b/templates/zerver/api/get-user-by-email.md index 1c892aa5e9..5d3d792f73 100644 --- a/templates/zerver/api/get-user-by-email.md +++ b/templates/zerver/api/get-user-by-email.md @@ -33,6 +33,6 @@ You may pass the `client_gravatar` or `include_custom_profile_fields` query para #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/{email}:get|fixture(200)} + +{generate_code_example|/users/{email}:get|fixture(400)} diff --git a/templates/zerver/api/get-user-groups.md b/templates/zerver/api/get-user-groups.md index 8d8fbd6db0..28ea365e94 100644 --- a/templates/zerver/api/get-user-groups.md +++ b/templates/zerver/api/get-user-groups.md @@ -29,6 +29,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/user_groups:get|fixture(200)} + +{generate_code_example|/user_groups:get|fixture(400)} diff --git a/templates/zerver/api/get-user-presence.md b/templates/zerver/api/get-user-presence.md index bd151d3c5f..78124ede8e 100644 --- a/templates/zerver/api/get-user-presence.md +++ b/templates/zerver/api/get-user-presence.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/{user_id_or_email}/presence:get|fixture(200)} + +{generate_code_example|/users/{user_id_or_email}/presence:get|fixture(400)} diff --git a/templates/zerver/api/get-user.md b/templates/zerver/api/get-user.md index 9209d29b4e..5c63ffc996 100644 --- a/templates/zerver/api/get-user.md +++ b/templates/zerver/api/get-user.md @@ -33,6 +33,6 @@ You may pass the `client_gravatar` or `include_custom_profile_fields` query para #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/{user_id}:get|fixture(200)} + +{generate_code_example|/users/{user_id}:get|fixture(400)} diff --git a/templates/zerver/api/get-users.md b/templates/zerver/api/get-users.md index 2d47c37495..675ff16a06 100644 --- a/templates/zerver/api/get-users.md +++ b/templates/zerver/api/get-users.md @@ -39,6 +39,6 @@ You may pass the `client_gravatar` query parameter as follows: #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users:get|fixture(200)} + +{generate_code_example|/users:get|fixture(400)} diff --git a/templates/zerver/api/mark-all-as-read.md b/templates/zerver/api/mark-all-as-read.md index c464d907b2..74b7601139 100644 --- a/templates/zerver/api/mark-all-as-read.md +++ b/templates/zerver/api/mark-all-as-read.md @@ -23,10 +23,9 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/mark_all_as_read:post|fixture(200)} +{generate_code_example|/mark_all_as_read:post|fixture(400)} {generate_api_title(/mark_stream_as_read:post)} @@ -55,10 +54,9 @@ A typical successful JSON response may look like: #### Example response -A typical successful JSON response may look like: - {generate_code_example|/mark_stream_as_read:post|fixture(200)} +{generate_code_example|/mark_stream_as_read:post|fixture(400)} # Mark messages in a topic as read {generate_api_title(/mark_topic_as_read:post)} @@ -88,6 +86,6 @@ A typical successful JSON response may look like: #### Example response -A typical successful JSON response may look like: - {generate_code_example|/mark_topic_as_read:post|fixture(200)} + +{generate_code_example|/mark_topic_as_read:post|fixture(400)} diff --git a/templates/zerver/api/mute-topic.md b/templates/zerver/api/mute-topic.md index cf8cd93d50..728fe5ea30 100644 --- a/templates/zerver/api/mute-topic.md +++ b/templates/zerver/api/mute-topic.md @@ -23,17 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me/subscriptions/muted_topics:patch|fixture(200)} - -An example JSON response for when an `add` operation is requested for a topic -that has already been muted: - -{generate_code_example|/users/me/subscriptions/muted_topics:patch|fixture(400_0)} - -An example JSON response for when a `remove` operation is requested for a -topic that had not been previously muted: - -{generate_code_example|/users/me/subscriptions/muted_topics:patch|fixture(400_1)} +{generate_code_example|/users/me/subscriptions/muted_topics:patch|fixture(400)} diff --git a/templates/zerver/api/mute-user.md b/templates/zerver/api/mute-user.md index 829ec98cfc..bf00576455 100644 --- a/templates/zerver/api/mute-user.md +++ b/templates/zerver/api/mute-user.md @@ -23,19 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me/muted_users/{muted_user_id}:post|fixture(200)} - -An example JSON response for when the user is yourself: - -{generate_code_example|/users/me/muted_users/{muted_user_id}:post|fixture(400_0)} - -An example JSON response for when the user is nonexistent or inaccessible: - -{generate_code_example|/users/me/muted_users/{muted_user_id}:post|fixture(400_1)} - -An example JSON response for when the user is already muted: - -{generate_code_example|/users/me/muted_users/{muted_user_id}:post|fixture(400_2)} +{generate_code_example|/users/me/muted_users/{muted_user_id}:post|fixture(400)} diff --git a/templates/zerver/api/reactivate-user.md b/templates/zerver/api/reactivate-user.md index 63ed5b106d..b03e718bd8 100644 --- a/templates/zerver/api/reactivate-user.md +++ b/templates/zerver/api/reactivate-user.md @@ -23,6 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/{user_id}/reactivate:post|fixture(200)} + +{generate_code_example|/users/{user_id}/reactivate:post|fixture(400)} diff --git a/templates/zerver/api/register-queue.md b/templates/zerver/api/register-queue.md index 1b669b3f90..455808bae9 100644 --- a/templates/zerver/api/register-queue.md +++ b/templates/zerver/api/register-queue.md @@ -76,6 +76,4 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/register:post|fixture(200)} diff --git a/templates/zerver/api/remove-code-playground.md b/templates/zerver/api/remove-code-playground.md index 2634917766..23b4114a6e 100644 --- a/templates/zerver/api/remove-code-playground.md +++ b/templates/zerver/api/remove-code-playground.md @@ -23,6 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/playgrounds/{playground_id}:delete|fixture(200)} + +{generate_code_example|/realm/playgrounds/{playground_id}:delete|fixture(400)} diff --git a/templates/zerver/api/remove-linkifier.md b/templates/zerver/api/remove-linkifier.md index 4e1c31a21f..776a1b9123 100644 --- a/templates/zerver/api/remove-linkifier.md +++ b/templates/zerver/api/remove-linkifier.md @@ -23,6 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/filters/{filter_id}:delete|fixture(200)} + +{generate_code_example|/realm/filters/{filter_id}:delete|fixture(400)} diff --git a/templates/zerver/api/remove-reaction.md b/templates/zerver/api/remove-reaction.md index fe31e53e77..754e6e0751 100644 --- a/templates/zerver/api/remove-reaction.md +++ b/templates/zerver/api/remove-reaction.md @@ -25,6 +25,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/{message_id}/reactions:delete|fixture(200)} + +{generate_code_example|/messages/{message_id}/reactions:delete|fixture(400)} diff --git a/templates/zerver/api/remove-user-group.md b/templates/zerver/api/remove-user-group.md index 97c9f31037..b73b32a12d 100644 --- a/templates/zerver/api/remove-user-group.md +++ b/templates/zerver/api/remove-user-group.md @@ -23,10 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/user_groups/{user_group_id}:delete|fixture(200)} -An example JSON error response for an invalid user group id: - {generate_code_example|/user_groups/{user_group_id}:delete|fixture(400)} diff --git a/templates/zerver/api/render-message.md b/templates/zerver/api/render-message.md index 062b4a1f3f..c381517d7f 100644 --- a/templates/zerver/api/render-message.md +++ b/templates/zerver/api/render-message.md @@ -33,6 +33,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/render:post|fixture(200)} + +{generate_code_example|/messages/render:post|fixture(400)} diff --git a/templates/zerver/api/reorder-custom-profile-fields.md b/templates/zerver/api/reorder-custom-profile-fields.md index 195f81693f..292aa5e5e6 100644 --- a/templates/zerver/api/reorder-custom-profile-fields.md +++ b/templates/zerver/api/reorder-custom-profile-fields.md @@ -28,6 +28,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/profile_fields:patch|fixture(200)} + +{generate_code_example|/realm/profile_fields:patch|fixture(400)} diff --git a/templates/zerver/api/send-message.md b/templates/zerver/api/send-message.md index 64b9ed8c7d..3694e896db 100644 --- a/templates/zerver/api/send-message.md +++ b/templates/zerver/api/send-message.md @@ -78,16 +78,7 @@ file. {generate_return_values_table|zulip.yaml|/messages:post} #### Example response -A typical successful JSON response may look like: {generate_code_example|/messages:post|fixture(200)} -A typical failed JSON response for when a stream message is sent to a stream -that does not exist: - -{generate_code_example|/messages:post|fixture(400_0)} - -A typical failed JSON response for when a private message is sent to a user -that does not exist: - -{generate_code_example|/messages:post|fixture(400_1)} +{generate_code_example|/messages:post|fixture(400)} diff --git a/templates/zerver/api/set-typing-status.md b/templates/zerver/api/set-typing-status.md index 72277efd2a..417b58217e 100644 --- a/templates/zerver/api/set-typing-status.md +++ b/templates/zerver/api/set-typing-status.md @@ -29,6 +29,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/typing:post|fixture(200)} + +{generate_code_example|/typing:post|fixture(400)} diff --git a/templates/zerver/api/subscribe.md b/templates/zerver/api/subscribe.md index 1d92cd1589..8d5700739e 100644 --- a/templates/zerver/api/subscribe.md +++ b/templates/zerver/api/subscribe.md @@ -38,22 +38,6 @@ the `principals` parameter, like so: #### Example response -A typical successful JSON response may look like: +{generate_code_example|/users/me/subscriptions:post|fixture(200)} -{generate_code_example|/users/me/subscriptions:post|fixture(200_0)} - -A typical successful JSON response when the user is already subscribed to -the streams specified: - -{generate_code_example|/users/me/subscriptions:post|fixture(200_1)} - -A typical response for when the requesting user does not have access to -a private stream and `authorization_errors_fatal` is `True`: - -{generate_code_example|/users/me/subscriptions:post|fixture(400_0)} - - -A typical response for when the requesting user does not have access to -a private stream and `authorization_errors_fatal` is `False`: - -{generate_code_example|/users/me/subscriptions:post|fixture(400_1)} +{generate_code_example|/users/me/subscriptions:post|fixture(400)} diff --git a/templates/zerver/api/unmute-user.md b/templates/zerver/api/unmute-user.md index 9606a7833e..0a3c259cc2 100644 --- a/templates/zerver/api/unmute-user.md +++ b/templates/zerver/api/unmute-user.md @@ -23,14 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me/muted_users/{muted_user_id}:delete|fixture(200)} -An example JSON response for when the user is nonexistent or inaccessible: - -{generate_code_example|/users/me/muted_users/{muted_user_id}:delete|fixture(400_0)} - -An example JSON response for when the user is not previously muted: - -{generate_code_example|/users/me/muted_users/{muted_user_id}:delete|fixture(400_1)} +{generate_code_example|/users/me/muted_users/{muted_user_id}:delete|fixture(400)} diff --git a/templates/zerver/api/unsubscribe.md b/templates/zerver/api/unsubscribe.md index b4ed4b56cf..5b6a8f5068 100644 --- a/templates/zerver/api/unsubscribe.md +++ b/templates/zerver/api/unsubscribe.md @@ -38,10 +38,6 @@ administrative privileges. #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me/subscriptions:delete|fixture(200)} -A typical failed JSON response for when the target stream does not exist: - {generate_code_example|/users/me/subscriptions:delete|fixture(400)} diff --git a/templates/zerver/api/update-display-settings.md b/templates/zerver/api/update-display-settings.md index 6ea17abe21..e4a10cee1d 100644 --- a/templates/zerver/api/update-display-settings.md +++ b/templates/zerver/api/update-display-settings.md @@ -30,6 +30,6 @@ those ones that were different from the already existing setting. #### Example response -A typical successful JSON response may look like: - {generate_code_example|/settings/display:patch|fixture(200)} + +{generate_code_example|/settings/display:patch|fixture(400)} diff --git a/templates/zerver/api/update-linkifier.md b/templates/zerver/api/update-linkifier.md index 6dc01736c4..75fa3adb5b 100644 --- a/templates/zerver/api/update-linkifier.md +++ b/templates/zerver/api/update-linkifier.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/filters/{filter_id}:patch|fixture(200)} + +{generate_code_example|/realm/filters/{filter_id}:patch|fixture(400)} diff --git a/templates/zerver/api/update-message-flags.md b/templates/zerver/api/update-message-flags.md index 635eff4ed3..f0c6f862d0 100644 --- a/templates/zerver/api/update-message-flags.md +++ b/templates/zerver/api/update-message-flags.md @@ -106,6 +106,6 @@ More examples and documentation can be found [here](https://github.com/zulip/zul #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/flags:post|fixture(200)} + +{generate_code_example|/messages/flags:post|fixture(400)} diff --git a/templates/zerver/api/update-message.md b/templates/zerver/api/update-message.md index 20cffdcad6..5d2f5fb652 100644 --- a/templates/zerver/api/update-message.md +++ b/templates/zerver/api/update-message.md @@ -38,11 +38,6 @@ You only have permission to edit a message if: #### Example response -A typical successful JSON response may look like: - {generate_code_example|/messages/{message_id}:patch|fixture(200)} -A typical JSON response for when one doesn't have the permission to -edit a particular message: - {generate_code_example|/messages/{message_id}:patch|fixture(400)} diff --git a/templates/zerver/api/update-notification-settings.md b/templates/zerver/api/update-notification-settings.md index e41141d1e0..84d1d396fc 100644 --- a/templates/zerver/api/update-notification-settings.md +++ b/templates/zerver/api/update-notification-settings.md @@ -30,6 +30,6 @@ those ones that were different than the already existing setting. #### Example response -A typical successful JSON response may look like: - {generate_code_example|/settings/notifications:patch|fixture(200)} + +{generate_code_example|/settings/notifications:patch|fixture(400)} diff --git a/templates/zerver/api/update-stream.md b/templates/zerver/api/update-stream.md index 29e2639872..fc6e235447 100644 --- a/templates/zerver/api/update-stream.md +++ b/templates/zerver/api/update-stream.md @@ -23,10 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/streams/{stream_id}:patch|fixture(200)} -An example JSON response for when the supplied stream does not exist: - {generate_code_example|/streams/{stream_id}:patch|fixture(400)} diff --git a/templates/zerver/api/update-subscription-settings.md b/templates/zerver/api/update-subscription-settings.md index 59c13d773e..a22bfb3c27 100644 --- a/templates/zerver/api/update-subscription-settings.md +++ b/templates/zerver/api/update-subscription-settings.md @@ -27,6 +27,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/me/subscriptions/properties:post|fixture(200)} + +{generate_code_example|/users/me/subscriptions/properties:post|fixture(400)} diff --git a/templates/zerver/api/update-user-group-members.md b/templates/zerver/api/update-user-group-members.md index 82e05800f5..c77bf5f29b 100644 --- a/templates/zerver/api/update-user-group-members.md +++ b/templates/zerver/api/update-user-group-members.md @@ -23,6 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/user_groups/{user_group_id}/members:post|fixture(200)} + +{generate_code_example|/user_groups/{user_group_id}/members:post|fixture(400)} diff --git a/templates/zerver/api/update-user-group.md b/templates/zerver/api/update-user-group.md index a62848deb7..6916d99666 100644 --- a/templates/zerver/api/update-user-group.md +++ b/templates/zerver/api/update-user-group.md @@ -23,10 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/user_groups/{user_group_id}:patch|fixture(200)} -An example JSON response when the user group ID is invalid: - {generate_code_example|/user_groups/{user_group_id}:patch|fixture(400)} diff --git a/templates/zerver/api/update-user.md b/templates/zerver/api/update-user.md index 75cd5c4148..972d13e8e7 100644 --- a/templates/zerver/api/update-user.md +++ b/templates/zerver/api/update-user.md @@ -23,10 +23,6 @@ #### Example response -A typical successful JSON response may look like: - {generate_code_example|/users/{user_id}:patch|fixture(200)} -A typical unsuccessful JSON response: - {generate_code_example|/users/{user_id}:patch|fixture(400)} diff --git a/templates/zerver/api/upload-custom-emoji.md b/templates/zerver/api/upload-custom-emoji.md index f52269e1b8..1dcc1458f6 100644 --- a/templates/zerver/api/upload-custom-emoji.md +++ b/templates/zerver/api/upload-custom-emoji.md @@ -41,6 +41,6 @@ to 5MB. ## Response #### Example response -A typical successful JSON response may look like: - {generate_code_example|/realm/emoji/{emoji_name}:post|fixture(200)} + +{generate_code_example|/realm/emoji/{emoji_name}:post|fixture(400)} diff --git a/templates/zerver/api/upload-file.md b/templates/zerver/api/upload-file.md index de1e6ce681..15a8a3d57d 100644 --- a/templates/zerver/api/upload-file.md +++ b/templates/zerver/api/upload-file.md @@ -38,6 +38,6 @@ to 25MB. #### Example response -A typical successful JSON response may look like: - {generate_code_example|/user_uploads:post|fixture(200)} + +{generate_code_example|/user_uploads:post|fixture(400)}