feat: add swagger

This commit is contained in:
2026-10-21 15:18:42 +03:00
parent a4b03c2a92
commit e20a5a4b4c
11 changed files with 666 additions and 42 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ def call(method, path, body=None, headers=None):
content_type = {'Content-Type': 'application/json'} if data else {}
request = urllib.request.Request(BASE + path, data=data, method=method, headers={**content_type, **(headers or {})})
try:
with urllib.request.urlopen(request, timeout=5) as response:
with urllib.request.urlopen(request, timeout=15) as response:
return response.status, json.loads(response.read() or b'null')
except urllib.error.HTTPError as error:
return error.code, json.loads(error.read() or b'null')