#2: fetch-openapi.sh — pass $OUT via sys.argv, not f-string in heredoc
Closes #2 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b14b8188fe
commit
5b0bec8850
1 changed files with 6 additions and 5 deletions
|
|
@ -29,9 +29,10 @@ curl -fsS "${AUTH_HEADER[@]}" "$URL" -o "$OUT"
|
||||||
|
|
||||||
# Verify it's actually JSON with an `openapi` key — oatpp sometimes returns
|
# Verify it's actually JSON with an `openapi` key — oatpp sometimes returns
|
||||||
# HTML on 401 which would silently land here otherwise.
|
# HTML on 401 which would silently land here otherwise.
|
||||||
python3 -c "
|
python3 - "$OUT" <<'PY'
|
||||||
import json, sys
|
import json, sys
|
||||||
d = json.load(open('$OUT'))
|
path = sys.argv[1]
|
||||||
assert 'openapi' in d, 'not an OpenAPI spec (missing \"openapi\" key)'
|
d = json.load(open(path))
|
||||||
print(f\" openapi={d['openapi']}, paths={len(d.get('paths', {}))}\")
|
assert 'openapi' in d, 'not an OpenAPI spec (missing "openapi" key)'
|
||||||
"
|
print(f" openapi={d['openapi']}, paths={len(d.get('paths', {}))}")
|
||||||
|
PY
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue