Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Commit a10acdd

Browse files
committed
new script to fetch openapi spec & spec indented for easier diffs
1 parent 6c7dd4a commit a10acdd

3 files changed

Lines changed: 46072 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ testpub:
2121
twine upload --repository testpypi dist/*
2222

2323
schema:
24-
curl "https://demo.defectdojo.org/api/v2/oa3/schema/?format=json" -o support/openapi.json
24+
./support/fetch_openapi.py
2525

2626
templates:
2727
./support/api_generation/dump_templates.sh

support/fetch_openapi.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python3
2+
3+
import json
4+
from pathlib import Path
5+
6+
import requests
7+
8+
HOST = 'https://demo.defectdojo.org'
9+
FILE = Path(__file__).parent / 'openapi.json'
10+
11+
12+
def main():
13+
r = requests.get(f'{HOST.rstrip("/")}/api/v2/oa3/schema/', params={'format': 'json'})
14+
r.raise_for_status()
15+
with FILE.open('w') as f:
16+
json.dump(r.json(), f, indent=4)
17+
18+
19+
if __name__ == '__main__':
20+
main()

support/openapi.json

Lines changed: 46051 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)