mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
docs: Make update-stream use curl example system.
new_name and description params should be valid JSON strings. The format of these params are marked as json so that the curl example genenrator can convert them into json strings.
This commit is contained in:
@@ -20,13 +20,7 @@ including:
|
||||
|
||||
{tab|curl}
|
||||
|
||||
``` curl
|
||||
curl -X PATCH {{ api_url }}/v1/streams/{stream_id} \
|
||||
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
|
||||
-d 'new_name="Manchester United"' \
|
||||
-d 'description="Biggest club in the world"' \
|
||||
-d 'is_private=false'
|
||||
```
|
||||
{generate_code_example(curl, include=["new_name", "description", "is_private"])|/streams/{stream_id}:patch|example}
|
||||
|
||||
{end_tabs}
|
||||
|
||||
|
||||
@@ -140,6 +140,8 @@ cURL example.""".format(endpoint, method, param_name)
|
||||
example_value = param.get("example", DEFAULT_EXAMPLE[param["schema"]["type"]])
|
||||
if type(example_value) == bool:
|
||||
example_value = str(example_value).lower()
|
||||
if param["schema"].get("format", "") == "json":
|
||||
example_value = json.dumps(example_value)
|
||||
if curl_argument:
|
||||
return " -d '{}={}'".format(param_name, example_value)
|
||||
return example_value
|
||||
|
||||
@@ -30,6 +30,7 @@ exclude_list = [
|
||||
'add-linkifiers.md',
|
||||
'get-events-from-queue.md',
|
||||
'delete-queue.md',
|
||||
'update-stream.md',
|
||||
# Endpoint can be called only by administrators.
|
||||
'create-user.md',
|
||||
'remove-linkifiers.md',
|
||||
|
||||
@@ -2502,6 +2502,7 @@ paths:
|
||||
description: The new description for the stream.
|
||||
schema:
|
||||
type: string
|
||||
format: json
|
||||
example: "This stream is related to football dicsussions."
|
||||
required: false
|
||||
- name: new_name
|
||||
@@ -2509,6 +2510,7 @@ paths:
|
||||
description: The new name for the stream.
|
||||
schema:
|
||||
type: string
|
||||
format: json
|
||||
example: "Italy"
|
||||
required: false
|
||||
- name: is_private
|
||||
|
||||
Reference in New Issue
Block a user