From 2a64f63073ef539a91aaf818dd6fe79078a45462 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 11 Dec 2024 09:44:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=BD=91=E9=A1=B5=E5=9C=B0=E5=9D=80swagger?= =?UTF-8?q?=E4=B8=8A=E6=B2=A1=E6=9C=89=E5=A1=AB=E5=86=99=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=BD=93=E7=9A=84=E5=9C=B0=E6=96=B9=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1050206 --user=王孝刚 【github#1809】【知识库】web知识库,批量导入网页地址时,抓到的接口有请求体,但是swagger上没有填写请求体的地方。 https://www.tapd.cn/57709429/s/1628286 --- apps/dataset/serializers/document_serializers.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/dataset/serializers/document_serializers.py b/apps/dataset/serializers/document_serializers.py index 677251eae40..80cfdccbe10 100644 --- a/apps/dataset/serializers/document_serializers.py +++ b/apps/dataset/serializers/document_serializers.py @@ -143,6 +143,18 @@ def get_request_params_api(): required=True, description='知识库id'), ] + @staticmethod + def get_request_body_api(): + return openapi.Schema( + type=openapi.TYPE_OBJECT, + required=['source_url_list'], + properties={ + 'source_url_list': openapi.Schema(type=openapi.TYPE_ARRAY, title="文档地址列表", description="文档地址列表", + items=openapi.Schema(type=openapi.TYPE_STRING)), + 'selector': openapi.Schema(type=openapi.TYPE_STRING, title="选择器", description="选择器") + } + ) + class DocumentInstanceSerializer(ApiMixin, serializers.Serializer):