MCPcopy
hub / github.com/openai/plugins / read_json_object

Function read_json_object

plugins/codex-security/scripts/workbench_db.py:3540–3550  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

3538
3539
3540def read_json_object(path: Path) -> dict[str, Any]:
3541 try:
3542 payload = json.loads(
3543 path.read_text(encoding="utf-8"),
3544 parse_constant=reject_non_finite_json,
3545 )
3546 except (OSError, ValueError) as exc:
3547 raise SystemExit(f"{path.name}: invalid JSON: {exc}") from exc
3548 if not isinstance(payload, dict):
3549 raise SystemExit(f"{path.name}: expected a JSON object.")
3550 return payload
3551
3552
3553def reject_non_finite_json(value: str) -> None:

Callers 3

complete_scan_lockedFunction · 0.85
export_findingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected