From 4364e31d699a8e39a34f49af23fee8266f6ef71a Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Thu, 10 Oct 2019 09:06:47 +0000 Subject: [PATCH] docs: Make update-subscription-properties use curl example system. --- .../zerver/api/update-subscription-properties.md | 11 +---------- zerver/openapi/test_curl_examples.py | 1 + zerver/openapi/zulip.yaml | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/templates/zerver/api/update-subscription-properties.md b/templates/zerver/api/update-subscription-properties.md index 81ad778456..34f8c89861 100644 --- a/templates/zerver/api/update-subscription-properties.md +++ b/templates/zerver/api/update-subscription-properties.md @@ -15,16 +15,7 @@ per-stream notification settings. {tab|curl} -``` curl -curl -X POST {{ api_url }}/v1/users/me/subscriptions/properties \ - -u BOT_EMAIL_ADDRESS:BOT_API_KEY \ - -d 'subscription_data=[{"stream_id": 1, \ - "property": "pin_to_top", \ - "value": true}, \ - {"stream_id": 3, \ - "property": "color", \ - "value": 'f00'}]' -``` +{generate_code_example(curl)|/users/me/subscriptions/properties:post|example} {end_tabs} diff --git a/zerver/openapi/test_curl_examples.py b/zerver/openapi/test_curl_examples.py index 40732f992d..eaf986ba3b 100644 --- a/zerver/openapi/test_curl_examples.py +++ b/zerver/openapi/test_curl_examples.py @@ -26,6 +26,7 @@ exclude_list = [ 'get-message-history.md', 'update-message-flags.md', 'mark-as-read-bulk.md', + 'update-subscription-properties.md', ] def test_generated_curl_examples_for_success(client: Client) -> None: diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 8856b80a8c..82887aece0 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -1815,7 +1815,7 @@ paths: type: array items: type: object - example: [{"stream_id": 1, "property": "pin_to_top", "value": true}] + example: [{"stream_id": 1, "property": "pin_to_top", "value": true}, {"stream_id": 3, "property": "color", "value": '#f00f00'}] required: true security: - basicAuth: []