mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
load_openapi_spec_async() hardcoded json.loads() / r.json() for both URL and local-file paths. YAML OpenAPI specs (common in the wild, e.g. firefly-iii, Petstore) fail with 'Expecting value: line 1 column 1' because YAML is not valid JSON. Detect YAML via file extension (.yaml/.yml) or Content-Type header and use yaml.safe_load(). For URLs without a YAML indicator, fall back to YAML parsing when JSON fails (handles raw GitHub URLs that serve YAML with text/plain Content-Type). Added 3 new tests: local YAML file, URL with YAML Content-Type, and URL with .yaml extension but plain text Content-Type. All 5 tests pass. Fixes #38951 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com> |
||
|---|---|---|
| .. | ||
| test_configs | ||
| conftest.py | ||
| mcp_e2e_upstream_server.py | ||
| mcp_server.py | ||
| test_aresponses_api_with_mcp.py | ||
| test_mcp_auth_header_extraction.py | ||
| test_mcp_auth_priority.py | ||
| test_mcp_chat_completions.py | ||
| test_mcp_client_unit.py | ||
| test_mcp_guardrails.py | ||
| test_mcp_hooks.py | ||
| test_mcp_litellm_client.py | ||
| test_mcp_logging.py | ||
| test_mcp_server.py | ||
| test_oauth2_mcp_config.yaml | ||
| test_openapi_spec_path_url.py | ||
| test_per_user_oauth_cache.py | ||
| test_proxy_mcp_e2e.py | ||
| test_semantic_tool_filter_e2e.py | ||