MCPcopy Create free account
hub / github.com/BerriAI/litellm / violations

Function violations

scripts/check_openapi_docs.py:52–60  ·  view source on GitHub ↗
(spec: Mapping[str, object])

Source from the content-addressed store, hash-verified

50
51
52def 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
63def proxy_spec() -> Mapping[str, object]:

Callers 1

mainFunction · 0.70

Calls 6

sortedFunction · 0.85
_operation_codesFunction · 0.85
_as_mappingFunction · 0.70
ViolationClass · 0.70
getMethod · 0.65
itemsMethod · 0.45

Tested by

no test coverage detected