mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
api_docs: Migrate POST /zulip-outgoing-webhook.
This commit migrates zulip outging webhook payload to /zulip-outgoing-webhook:post in OpenAPI. Since this migrates the last payloads from api/fixtures.json to OpenAPI, this commit removes api/fixtures.json file and the functions accessing the file. Tweaked by tabbott to further remove an unnecessary conditional.
This commit is contained in:
committed by
Tim Abbott
parent
6ebf408fc4
commit
793c3f25e7
@@ -300,8 +300,6 @@ class APICodeExamplesPreprocessor(Preprocessor):
|
||||
if key == 'fixture':
|
||||
if argument:
|
||||
text = self.render_fixture(function, name=argument)
|
||||
else:
|
||||
text = self.render_fixture(function)
|
||||
elif key == 'example':
|
||||
if argument == 'admin_config=True':
|
||||
text = SUPPORTED_LANGUAGES[language]['render'](function, admin_config=True)
|
||||
@@ -325,15 +323,8 @@ class APICodeExamplesPreprocessor(Preprocessor):
|
||||
def render_fixture(self, function: str, name: Optional[str]=None) -> List[str]:
|
||||
fixture = []
|
||||
|
||||
# We assume that if the function we're rendering starts with a slash
|
||||
# it's a path in the endpoint and therefore it uses the new OpenAPI
|
||||
# format.
|
||||
if function.startswith('/'):
|
||||
path, method = function.rsplit(':', 1)
|
||||
fixture_dict = get_openapi_fixture(path, method, name)
|
||||
else:
|
||||
fixture_dict = zerver.openapi.python_examples.FIXTURES[function]
|
||||
|
||||
path, method = function.rsplit(':', 1)
|
||||
fixture_dict = get_openapi_fixture(path, method, name)
|
||||
fixture_json = json.dumps(fixture_dict, indent=4, sort_keys=True,
|
||||
separators=(',', ': '))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user