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: Merge success examples for POST users/me/subscriptions.

Anders Kaseorg02c1196e3e79
diff --git a/zerver/openapi/python_examples.py b/zerver/openapi/python_examples.py
index 408db0b8517..e4d425b559f 100644
--- a/zerver/openapi/python_examples.py
+++ b/zerver/openapi/python_examples.py
@@ -78,7 +78,7 @@ def add_subscriptions(client: Client) -> None:
)
# {code_example|end}
- validate_against_openapi_schema(result, "/users/me/subscriptions", "post", "200_0")
+ validate_against_openapi_schema(result, "/users/me/subscriptions", "post", "200")
ensure_users([26], ["newbie"])
# {code_example|start}
@@ -104,7 +104,7 @@ def test_add_subscriptions_already_subscribed(client: Client) -> None:
principals=["[email protected]"],
)
- validate_against_openapi_schema(result, "/users/me/subscriptions", "post", "200_1")
+ validate_against_openapi_schema(result, "/users/me/subscriptions", "post", "200")
def test_authorization_errors_fatal(client: Client, nonadmin_client: Client) -> None:
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 6f05b2dca77..a54ee0447f5 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -6699,30 +6699,17 @@ paths:
content:
application/json:
schema:
- oneOf:
- - allOf:
- - $ref: "#/components/schemas/AddSubscriptionsResponse"
- - $ref: "#/components/schemas/SuccessDescription"
- - example:
- {
- "already_subscribed": {},
- "msg": "",
- "result": "success",
- "subscribed": {"[email protected]": ["new stream"]},
- }
- - allOf:
- - $ref: "#/components/schemas/AddSubscriptionsResponse"
- - example:
- {
- "already_subscribed":
- {"[email protected]": ["new stream"]},
- "msg": "",
- "result": "success",
- "subscribed": {},
- }
- description: |
- A typical successful JSON response when the user is already subscribed to
- the streams specified
+ allOf:
+ - $ref: "#/components/schemas/AddSubscriptionsResponse"
+ - $ref: "#/components/schemas/SuccessDescription"
+ - example:
+ {
+ "already_subscribed":
+ {"[email protected]": ["new stream"]},
+ "msg": "",
+ "result": "success",
+ "subscribed": {"[email protected]": ["new stream"]},
+ }
"400":
description: Bad request.
content: