We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 886956c commit 6f36932Copy full SHA for 6f36932
scripts/api-specs-update.py
@@ -0,0 +1,20 @@
1
+#!/usr/bin/env python3
2
+
3
+"""Update the latest api specs file from a running django server"""
4
5
+import sys
6
7
+import urllib.request
8
+import urllib.error
9
10
11
+try:
12
+ urllib.request.urlretrieve(
13
+ "http://127.0.0.1:8000/api/schema", "docs/assets/schemas/api-latest.yaml"
14
+ )
15
+except urllib.error.URLError as e:
16
+ print(f"Could not fetch latests API specs: {e}", file=sys.stderr)
17
+ print("Make sure that the django server is running", file=sys.stderr)
18
+ sys.exit(1)
19
20
+print("Api specs successfully updated")
0 commit comments