(payload: dict[str, Any], key: str, context: str)
| 135 | |
| 136 | |
| 137 | def _require_str(payload: dict[str, Any], key: str, context: str) -> str: |
| 138 | value = payload.get(key) |
| 139 | if not isinstance(value, str) or not value.strip(): |
| 140 | raise ContractError(f"{context}.{key}: expected a non-empty string") |
| 141 | return value |
| 142 | |
| 143 | |
| 144 | def _require_safe_relative_path(value: str, context: str, *, allow_dot: bool = False) -> str: |
no test coverage detected