Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

openapi: Remove ‘example’ $ref siblings.

Anders Kaseorg7c17bdb9c524
diff --git a/zerver/openapi/test_curl_examples.py b/zerver/openapi/test_curl_examples.py
index 10a2de3b4b0..bd36c4bcc01 100644
--- a/zerver/openapi/test_curl_examples.py
+++ b/zerver/openapi/test_curl_examples.py
@@ -22,11 +22,15 @@ def test_generated_curl_examples_for_success(client: Client) -> None:
md_engine = markdown.Markdown(extensions=[markdown_extension.makeExtension(
api_url=realm.uri + "/api")])
- # We run our curl tests in alphabetical order, since we depend
+ # We run our curl tests in alphabetical order (except that we
+ # delay the deactivate-user test to the very end), since we depend
# on "add" tests coming before "remove" tests in some cases. We
# should try to either avoid ordering dependencies or make them
# very explicit.
- for file_name in sorted(glob.glob("templates/zerver/api/*.md")):
+ for file_name in sorted(
+ glob.glob("templates/zerver/api/*.md"),
+ key=lambda file_name: (file_name == "templates/zerver/api/deactivate-user.md", file_name),
+ ):
documentation_lines = open(file_name).readlines()
for line in documentation_lines:
# A typical example from the Markdown source looks like this:
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index e99879d0fa7..9f6eeaa679a 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -4978,9 +4978,7 @@ paths:
**Changes**: New in Zulip 3.0 (feature level 11).
parameters:
- $ref: "#/components/parameters/UserId"
- example: 7
- $ref: "#/components/parameters/StreamIdInPath"
- example: 1
responses:
"200":
description: Success
@@ -8272,7 +8270,6 @@ paths:
`POST {{ api_url }}/v1/user_groups/{user_group_id}/members`
parameters:
- $ref: "#/components/parameters/UserGroupId"
- example: 1
- name: delete
in: query
description: |
@@ -9924,7 +9921,7 @@ components:
The ID of the target user group.
schema:
type: integer
- example: 42
+ example: 1
required: true
Topic:
name: topic
@@ -9957,7 +9954,7 @@ components:
The ID of the stream to access.
schema:
type: integer
- example: 42
+ example: 1
required: true
ClientGravatar:
name: client_gravatar