From 9e696451c089a2028b3c76650640e3b4d3a6251f Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 17 Dec 2025 14:15:14 +0800 Subject: [PATCH] refactor: move OpenApiParameter definitions to schema for better organization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1064802 --user=刘瑞斌 【接口文档】/admin/api/workspace/{workspace_id}/knowledge/{knowledge_id}/document/split 接口的参数传递方式错了 https://www.tapd.cn/62980211/s/1813972 --- apps/knowledge/api/document.py | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/apps/knowledge/api/document.py b/apps/knowledge/api/document.py index 6ced11c6c31..8ba9d3b4fd3 100644 --- a/apps/knowledge/api/document.py +++ b/apps/knowledge/api/document.py @@ -20,28 +20,6 @@ def get_parameters(): location='path', required=True, ), - - OpenApiParameter( - name="limit", - description="分段长度", - type=OpenApiTypes.INT, - location='query', - required=False, - ), - OpenApiParameter( - name="patterns", - description="分段正则列表", - type=OpenApiTypes.STR, - location='query', - required=False, - ), - OpenApiParameter( - name="with_filter", - description="是否清除特殊字符", - type=OpenApiTypes.BOOL, - location='query', - required=False, - ), ] @staticmethod @@ -53,6 +31,18 @@ def get_request(): 'file': { 'type': 'string', 'format': 'binary' # Tells Swagger it's a file + }, + 'limit': { + 'type': 'integer', + 'description': '分段长度' + }, + 'patterns': { + 'type': 'string', + 'description': '分段正则列表' + }, + 'with_filter': { + 'type': 'boolean', + 'description': '是否清除特殊字符' } } }