(payload: dict[str, Any], key: str, context: str)
| 121 | |
| 122 | |
| 123 | def _require_dict(payload: dict[str, Any], key: str, context: str) -> dict[str, Any]: |
| 124 | value = payload.get(key) |
| 125 | if not isinstance(value, dict): |
| 126 | raise ContractError(f"{context}.{key}: expected an object") |
| 127 | return value |
| 128 | |
| 129 | |
| 130 | def _require_list(payload: dict[str, Any], key: str, context: str) -> list[Any]: |
no test coverage detected