mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
Merge c4aa6e850b into c905cd065d
This commit is contained in:
commit
0a4f07d8dd
3 changed files with 18 additions and 1 deletions
|
|
@ -20903,7 +20903,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):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ GET /team/available
|
|||
GET /team/metadata_schema
|
||||
GET /team/{team_id}/members/me
|
||||
GET /user/available_users
|
||||
GET /config/yaml # docs-only mock; renders the config.yaml reference page in Swagger
|
||||
|
||||
# Imperative one-shot operations: bulk edits, rotation, health probes, test hooks,
|
||||
# migrations, and approval workflows; procedural, not declarative state
|
||||
|
|
|
|||
|
|
@ -303,6 +303,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"],
|
||||
}
|
||||
|
||||
|
||||
async def test_a_request_is_answered_while_a_cold_openapi_json_builds(monkeypatch: pytest.MonkeyPatch):
|
||||
build_started: Final = threading.Event()
|
||||
liveliness_answered: Final = threading.Event()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue