mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
fix: restore OpenAPI file uploads
Expose /api/v1/file in OpenAPI, enable file-scoped API keys, and regenerate docs/client artifacts.
This commit is contained in:
@@ -1023,6 +1023,7 @@ async def test_v1_openapi_is_served_by_fastapi(asgi_client: httpx.AsyncClient):
|
||||
assert "/api/v1/conversations" in spec["paths"]
|
||||
assert "/api/v1/mcp/servers" in spec["paths"]
|
||||
assert "/api/v1/skills" in spec["paths"]
|
||||
assert "/api/v1/file" in spec["paths"]
|
||||
|
||||
|
||||
def test_static_openapi_v1_paths_include_api_version():
|
||||
@@ -1140,6 +1141,12 @@ async def test_v1_openapi_uses_pydantic_request_bodies(
|
||||
"$ref"
|
||||
].endswith("/ConfigContentRequest")
|
||||
|
||||
open_api_file_upload = spec["paths"]["/api/v1/file"]["post"]
|
||||
assert open_api_file_upload["requestBody"]["content"]["multipart/form-data"][
|
||||
"schema"
|
||||
]["$ref"].endswith("/Body_uploadOpenApiFile")
|
||||
assert open_api_file_upload["x-astrbot-scope"] == "file"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_v1_conversation_path_id_allows_slash(asgi_client: httpx.AsyncClient):
|
||||
|
||||
Reference in New Issue
Block a user