Fix: add /v1/document/upload_info -> /api/v1/documents/upload back (#16264)

This commit is contained in:
Wang Qi
2026-06-23 17:47:55 +08:00
committed by GitHub
parent aba5d172bd
commit a4f325be24
2 changed files with 29 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ Deprecated APIs and their replacements:
- PUT /api/v1/chats/{chat_id}/sessions/{session_id} -> PATCH /api/v1/chats/{chat_id}/sessions/{session_id}
- DELETE /api/v1/chats -> DELETE /api/v1/chats/{chat_id} (with body)
- POST /api/v1/file/convert -> POST /api/v1/files/link-to-datasets
- POST /v1/document/upload_info -> POST /api/v1/documents/upload
- GET /api/v1/file/* -> GET /api/v1/files*
- POST /api/v1/file/* -> POST /api/v1/files*
- GET /api/v1/document/get/{doc_id} -> GET /api/v1/documents/{doc_id}/preview
@@ -563,6 +564,25 @@ async def deprecated_file_upload_info():
return await document_api.upload_info(tenant_id=tenant_id)
@legacy_v1_manager.route("/document/upload_info", methods=["POST"])
@login_required
async def deprecated_legacy_document_upload_info():
"""
Deprecated: Use POST /api/v1/documents/upload instead.
Old path: POST /v1/document/upload_info
New path: POST /api/v1/documents/upload
"""
from api.apps import current_user
logging.warning(
"API endpoint /v1/document/upload_info is deprecated. "
"Please use POST /api/v1/documents/upload instead."
)
tenant_id = current_user.id
return await document_api.upload_info(tenant_id=tenant_id)
# =============================================================================
# Document APIs
# =============================================================================