17 lines
453 B
Python
17 lines
453 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
from fastapi import HTTPException, status
|
|
|
|
|
|
def read_normalized_payload_from_path(normalized_storage_path: str) -> dict:
|
|
path = Path(normalized_storage_path)
|
|
|
|
if not path.exists() or not path.is_file():
|
|
raise HTTPException(
|
|
status_code=status.HTTP_404_NOT_FOUND,
|
|
detail="Normalized snapshot file not found",
|
|
)
|
|
|
|
return json.loads(path.read_text(encoding="utf-8"))
|