INNER CODE UNIT · Python
api_json
dotnet/sdk · .github/scripts/check_vendored_files.py:174
def api_json(path: str) -> tuple[int, Any]:
url = f"{API_BASE}{path}"
status, body, _ = _request(url)
if not body:
return status, None
try:
return status, json.loads(body)
except json.JSONDecodeError:
return status, None
def fetch_blob_content(repo: str, blob_sha: str) -> str | None:
status, data = api_json(f"/repos/{repo}/git/blobs/{blob_sha}")
if status != 200 or not isinstance(data, dict):
return None
if data.get("encoding") != "base64":
return None
try: