MCPcopy Index your code
hub / github.com/openai/plugins / _json_bytes

Function _json_bytes

plugins/codex-security/scripts/finalize_scan_contract.py:99–104  ·  view source on GitHub ↗
(payload: Any)

Source from the content-addressed store, hash-verified

97
98
99def _json_bytes(payload: Any) -> bytes:
100 try:
101 encoded = json.dumps(payload, allow_nan=False, indent=2, sort_keys=True)
102 except ValueError as exc:
103 raise ContractError(f"cannot encode canonical JSON: {exc}") from exc
104 return (encoded + "\n").encode("utf-8")
105
106
107def _sha256_text(value: str) -> str:

Callers 3

_write_jsonFunction · 0.85
_write_scan_local_jsonFunction · 0.85
finalize_scanFunction · 0.85

Calls 1

ContractErrorClass · 0.85

Tested by

no test coverage detected