refactor: 修复主键列表字段的 Swagger 文档生成
- 更新 keys 变量定义,使用 Schema 嵌套来正确表示主键列表的类型 -优化 Swagger 文档中的请求体定义,提高 API 文档的准确性和可读性
This commit is contained in:
@@ -131,8 +131,7 @@ class CustomModelViewSet(ModelViewSet, ImportSerializerMixin, ExportSerializerMi
|
||||
instance.delete()
|
||||
return DetailResponse(data=[], msg="删除成功")
|
||||
|
||||
keys = openapi.Schema(description='主键列表', type=openapi.TYPE_ARRAY, items=openapi.TYPE_STRING)
|
||||
|
||||
keys = openapi.Schema(description='主键列表', type=openapi.TYPE_ARRAY, items=openapi.Schema(type=openapi.TYPE_STRING))
|
||||
@swagger_auto_schema(request_body=openapi.Schema(
|
||||
type=openapi.TYPE_OBJECT,
|
||||
required=['keys'],
|
||||
|
||||
Reference in New Issue
Block a user