mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
openapi: Merge success examples for POST users/me/subscriptions.
oneOf with two identical branches (modulo example) is a bug because oneOf means exclusive or. It’s also a totally inappropriate kludge for encoding multiple examples. The OpenAPI specification provides a perfectly good standard way to do that: https://spec.openapis.org/oas/v3.0.3#example-object However, we don’t handle that in our OpenAPI documentation generator yet, so for now just merge the examples. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
e9fd52da01
commit
02c1196e3e
@@ -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=["newbie@zulip.com"],
|
||||
)
|
||||
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user