mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-25 21:33:48 +03:00
script to generate latest api specs file (#1374)
This commit is contained in:
parent
fbbccc186d
commit
d07c491f40
20
scripts/api-specs-update.py
Executable file
20
scripts/api-specs-update.py
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Update the latest api specs file from a running django server"""
|
||||
|
||||
import sys
|
||||
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
|
||||
|
||||
try:
|
||||
urllib.request.urlretrieve(
|
||||
"http://127.0.0.1:8000/api/schema", "docs/assets/schemas/api-latest.yaml"
|
||||
)
|
||||
except urllib.error.URLError as e:
|
||||
print(f"Could not fetch latests API specs: {e}", file=sys.stderr)
|
||||
print("Make sure that the django server is running", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print("Api specs successfully updated")
|
Loading…
Reference in New Issue
Block a user