openapi: Remove ‘example’ $ref siblings.

$ref siblings are ignored according to the OpenAPI specification, and
the referenced definitions already have examples.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-09-11 22:06:07 -07:00
committed by Tim Abbott
parent caa08d76b5
commit 7c17bdb9c5
2 changed files with 8 additions and 7 deletions

View File

@@ -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: