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

Function _operation_codes

scripts/check_openapi_docs.py:42–49  ·  view source on GitHub ↗
(operation: Mapping[str, object])

Source from the content-addressed store, hash-verified

40
41
42def _operation_codes(operation: Mapping[str, object]) -> Iterator[str]:
43 if not _content_schema(operation.get("requestBody")):
44 yield "OA001"
45 description: Final = operation.get("description")
46 if not isinstance(description, str) or not description.strip():
47 yield "OA002"
48 if not _content_schema(_as_mapping(operation.get("responses")).get("200")):
49 yield "OA003"
50
51
52def violations(spec: Mapping[str, object]) -> tuple[Violation, ...]:

Callers 1

violationsFunction · 0.85

Calls 4

_content_schemaFunction · 0.85
stripMethod · 0.80
_as_mappingFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected