fix(api): align Swagger schemas for UserSettings and TopicListResponse (#38590)

Corrects the Swagger/OpenAPI schemas for `/user/settings` and
`/topics/search` to match the actual JSON objects returned by the API.

Signed-off-by: Sudhanshu Singh <sudhanshuwriterblc@gmail.com>
This commit is contained in:
Shudhanshu Singh
2026-07-23 12:19:52 +05:30
committed by GitHub
parent 20221e1faa
commit 560edd45e9
6 changed files with 41 additions and 20 deletions
+2 -2
View File
@@ -300,7 +300,7 @@ func TopicSearch(ctx *context.APIContext) {
}
ctx.SetTotalCountHeader(total)
ctx.JSON(http.StatusOK, map[string]any{
"topics": topicResponses,
ctx.JSON(http.StatusOK, api.TopicListResponse{
Topics: topicResponses,
})
}
+1 -1
View File
@@ -341,7 +341,7 @@ type swaggerFileDeleteResponse struct {
// swagger:response TopicListResponse
type swaggerTopicListResponse struct {
// in: body
Body []api.TopicResponse `json:"body"`
Body api.TopicListResponse `json:"body"`
}
// TopicNames
+1 -1
View File
@@ -46,7 +46,7 @@ type swaggerResponseUserHeatmapData struct {
// swagger:response UserSettings
type swaggerResponseUserSettings struct {
// in:body
Body []api.UserSettings `json:"body"`
Body api.UserSettings `json:"body"`
}
// BadgeList