| 57 | |
| 58 | |
| 59 | def load_json_requests(args: argparse.Namespace) -> list[dict[str, Any]]: |
| 60 | if args.request_sequence_json: |
| 61 | payload = json.loads(args.request_sequence_json) |
| 62 | if not isinstance(payload, list): |
| 63 | raise RuntimeError("--request-sequence-json must decode to a list") |
| 64 | return payload |
| 65 | if args.request_json: |
| 66 | payload = json.loads(args.request_json) |
| 67 | if not isinstance(payload, dict): |
| 68 | raise RuntimeError("--request-json must decode to an object") |
| 69 | return [payload] |
| 70 | return [] |
| 71 | |
| 72 | |
| 73 | def require_request_path(request: dict[str, Any], key: str) -> Path: |