mirror of https://github.com/zulip/zulip.git
openapi: Improve deprecation error messages.
This commit is contained in:
parent
d60150d39d
commit
97fd5b8c6f
|
@ -521,9 +521,13 @@ def deprecated_note_in_description(description: str) -> bool:
|
|||
def check_deprecated_consistency(deprecated: bool, description: str) -> None:
|
||||
# Test to make sure deprecated parameters are marked so.
|
||||
if deprecated_note_in_description(description):
|
||||
assert deprecated
|
||||
assert (
|
||||
deprecated
|
||||
), f"Missing `deprecated: true` despite being described as deprecated:\n\n{description}\n"
|
||||
if deprecated:
|
||||
assert deprecated_note_in_description(description)
|
||||
assert deprecated_note_in_description(
|
||||
description
|
||||
), f"Marked as `deprecated: true`, but changes documentation doesn't properly explain as **Deprecated** in the standard format\n\n:{description}\n"
|
||||
|
||||
|
||||
# Skip those JSON endpoints whose query parameters are different from
|
||||
|
|
Loading…
Reference in New Issue