Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

批量获取用户接口/api/v2/batch/profiles/,swagger显示的是没有参数,但实际代码中校验参数query_ids #26

Closed
Ysach opened this issue Aug 20, 2021 · 1 comment · Fixed by #56
Assignees
Labels
Layer: api Api module related Type: bug Something isn't working
Milestone

Comments

@Ysach
Copy link

Ysach commented Aug 20, 2021

访问批量获取用户接口/api/v2/batch/profiles/,返回错误:
{"result":false,"data":null,"code":-1,"message":"request failed, please check api log of bk-user"}

源码:
bkuser_core-->common-->viewset.py的mutliple_retrieve获取query_ids

建议修改文件 bkuser_core/profiles/views.py:

@swagger_auto_schema(
manual_parameters=[],
responses={"200": local_serializers.ProfileSerializer()},
tags=["profiles"],
)

bkuser_core/profiles/views.py文件增加导入 openapi

from drf_yasg import openapi

swagger部分修改:

@swagger_auto_schema(
    manual_parameters=[openapi.Parameter("query_ids", openapi.IN_QUERY,
                                         description="input departments query_ids,逗号分割",
                                         type=openapi.TYPE_STRING)],
    responses={"200": local_serializers.ProfileSerializer(many=True)},
)
@Ysach Ysach added the Type: bug Something isn't working label Aug 20, 2021
@IMBlues IMBlues added this to the v2.3.0 milestone Aug 20, 2021
@IMBlues IMBlues added the Layer: api Api module related label Aug 20, 2021
@IMBlues
Copy link
Contributor

IMBlues commented Aug 20, 2021

确实有这个问题。我们会在 milestone 前修复这个问题,当然如果有余力可以提交 PR 就更好啦。

@IMBlues IMBlues modified the milestones: v2.3.0, Y2021M08H2 Aug 23, 2021
@IMBlues IMBlues self-assigned this Aug 23, 2021
@IMBlues IMBlues linked a pull request Sep 3, 2021 that will close this issue
@IMBlues IMBlues modified the milestones: Y2021M08H2, 202109H1 Sep 6, 2021
IMBlues added a commit that referenced this issue Sep 6, 2021
fix: adding query_serializer for profiles batch retrieve #26
@IMBlues IMBlues closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: api Api module related Type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants