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

Swagger: Fix response for the search users endpoint #71272

Merged
merged 2 commits into from Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions pkg/api/user.go
Expand Up @@ -627,13 +627,6 @@ type UpdateUserParams struct {
UserID int64 `json:"user_id"`
}

// swagger:response searchUsersResponse
type SearchUsersResponse struct {
// The response message
// in: body
Body user.SearchUserQueryResult `json:"body"`
}

// swagger:response userResponse
type UserResponse struct {
// The response message
Expand Down
16 changes: 15 additions & 1 deletion pkg/services/searchusers/searchusers.go
Expand Up @@ -53,7 +53,7 @@ func (s *OSSService) SearchUsers(c *contextmodel.ReqContext) response.Response {
// Get users with paging.
//
// Responses:
// 200: searchUsersResponse
// 200: searchUsersWithPagingResponse
// 401: unauthorisedError
// 403: forbiddenError
// 404: notFoundError
Expand Down Expand Up @@ -115,3 +115,17 @@ func (s *OSSService) SearchUser(c *contextmodel.ReqContext) (*user.SearchUserQue

return res, nil
}

// swagger:response searchUsersResponse
type SearchUsersResponse struct {
// The response message
// in: body
Body []*user.UserSearchHitDTO `json:"body"`
}

// swagger:response searchUsersWithPagingResponse
type SearchUsersWithPagingResponse struct {
// The response message
// in: body
Body *user.SearchUserQueryResult `json:"body"`
}