mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
fix(proxy): restore the config.yaml docs page in the OpenAPI schema
This commit is contained in:
parent
50ab9a3211
commit
928c7db759
2 changed files with 17 additions and 1 deletions
|
|
@ -19643,7 +19643,6 @@ async def get_config(
|
|||
"/config/yaml",
|
||||
tags=["config.yaml"],
|
||||
dependencies=[Depends(user_api_key_auth)],
|
||||
include_in_schema=False,
|
||||
)
|
||||
async def config_yaml_endpoint(config_info: ConfigYAML):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -281,6 +281,23 @@ def test_get_openapi_schema_missing_app_attribute_raises_error(monkeypatch):
|
|||
get_openapi_schema()
|
||||
|
||||
|
||||
def test_get_openapi_schema_documents_config_yaml(monkeypatch):
|
||||
"""The /config/yaml mock endpoint must stay in the spec so Swagger renders
|
||||
its config.yaml tag section and the ConfigYAML component schema."""
|
||||
import litellm.proxy.proxy_server as ps
|
||||
|
||||
monkeypatch.setattr(ps.app, "openapi_schema", None, raising=True)
|
||||
schema = get_openapi_schema()
|
||||
observed = {
|
||||
"component_present": "ConfigYAML" in schema["components"]["schemas"],
|
||||
"tags": schema["paths"]["/config/yaml"]["get"]["tags"],
|
||||
}
|
||||
assert normalize(observed) == {
|
||||
"component_present": True,
|
||||
"tags": ["config.yaml"],
|
||||
}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# custom_openapi
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue