From fdd95b2e6b5af5a78873d09eecda1a36e555d744 Mon Sep 17 00:00:00 2001 From: Alexandre Franke Date: Tue, 1 Feb 2022 08:49:54 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20identation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexandre Franke --- scripts/dump-swagger.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/scripts/dump-swagger.py b/scripts/dump-swagger.py index dad53917c..31004f733 100755 --- a/scripts/dump-swagger.py +++ b/scripts/dump-swagger.py @@ -93,12 +93,12 @@ parser.add_argument( %(default)s""", ) available_apis = { - "client-server": "Matrix Client-Server API", - "server-server": "Matrix Server-Server API", - "application-service": "Matrix Application Service API", - "identity": "Matrix Identity Service API", - "push-gateway": "Matrix Push Gateway API", - } + "client-server": "Matrix Client-Server API", + "server-server": "Matrix Server-Server API", + "application-service": "Matrix Application Service API", + "identity": "Matrix Identity Service API", + "push-gateway": "Matrix Push Gateway API", +} parser.add_argument( "--api", default="client-server", @@ -133,15 +133,17 @@ output = { # The servers value will be picked up by RapiDoc to provide a way # to switch API servers. Useful when one wants to test compliance # of their server with the API. - "servers": [{ - "url": "https://{homeserver_address}/", - "variables": { - "homeserver_address": { - "default": "matrix-client.matrix.org", - "description": "The base URL for your homeserver", - } + "servers": [ + { + "url": "https://{homeserver_address}/", + "variables": { + "homeserver_address": { + "default": "matrix-client.matrix.org", + "description": "The base URL for your homeserver", + } + }, } - }], + ], "schemes": ["https"], "info": { "title": available_apis[selected_api], @@ -154,8 +156,7 @@ output = { selected_api_dir = os.path.join(api_dir, selected_api) try: - with open(os.path.join(selected_api_dir, 'definitions', - 'security.yaml')) as f: + with open(os.path.join(selected_api_dir, 'definitions', 'security.yaml')) as f: output['securityDefinitions'] = yaml.safe_load(f) except FileNotFoundError: print("No security definitions available for this API")