(spec: Mapping[str, object])
| 50 | |
| 51 | |
| 52 | def violations(spec: Mapping[str, object]) -> tuple[Violation, ...]: |
| 53 | paths: Final = _as_mapping(spec.get("paths")) |
| 54 | return tuple( |
| 55 | Violation(method.upper(), path, code) |
| 56 | for path, operations in sorted(paths.items()) |
| 57 | for method, operation in sorted(_as_mapping(operations).items()) |
| 58 | if method in GATED_METHODS |
| 59 | for code in _operation_codes(_as_mapping(operation)) |
| 60 | ) # comprehension-ok: one pass over path, method and code is the whole scan |
| 61 | |
| 62 | |
| 63 | def proxy_spec() -> Mapping[str, object]: |
no test coverage detected