Backport #38590 Signed-off-by: Sudhanshu Singh <sudhanshuwriterblc@gmail.com> Co-authored-by: Shudhanshu Singh <sudhanshuwriterblc@gmail.com>
This commit is contained in:
@@ -32,3 +32,8 @@ type RepoTopicOptions struct {
|
||||
// list of topic names
|
||||
Topics []string `json:"topics"`
|
||||
}
|
||||
|
||||
// TopicListResponse returns a list of TopicResponse
|
||||
type TopicListResponse struct {
|
||||
Topics []*TopicResponse `json:"topics"`
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ type swaggerFileDeleteResponse struct {
|
||||
// swagger:response TopicListResponse
|
||||
type swaggerTopicListResponse struct {
|
||||
// in: body
|
||||
Body []api.TopicResponse `json:"body"`
|
||||
Body api.TopicListResponse `json:"body"`
|
||||
}
|
||||
|
||||
// TopicNames
|
||||
|
||||
@@ -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
|
||||
|
||||
Generated
+16
-8
@@ -30294,6 +30294,20 @@
|
||||
},
|
||||
"x-go-package": "gitea.dev/modules/structs"
|
||||
},
|
||||
"TopicListResponse": {
|
||||
"description": "TopicListResponse returns a list of TopicResponse",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"topics": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TopicResponse"
|
||||
},
|
||||
"x-go-name": "Topics"
|
||||
}
|
||||
},
|
||||
"x-go-package": "gitea.dev/modules/structs"
|
||||
},
|
||||
"TopicName": {
|
||||
"description": "TopicName a list of repo topic names",
|
||||
"type": "object",
|
||||
@@ -31920,10 +31934,7 @@
|
||||
"TopicListResponse": {
|
||||
"description": "TopicListResponse",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TopicResponse"
|
||||
}
|
||||
"$ref": "#/definitions/TopicListResponse"
|
||||
}
|
||||
},
|
||||
"TopicNames": {
|
||||
@@ -31974,10 +31985,7 @@
|
||||
"UserSettings": {
|
||||
"description": "UserSettings",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/UserSettings"
|
||||
}
|
||||
"$ref": "#/definitions/UserSettings"
|
||||
}
|
||||
},
|
||||
"VariableList": {
|
||||
|
||||
Generated
+16
-8
@@ -1452,10 +1452,7 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/TopicResponse"
|
||||
},
|
||||
"type": "array"
|
||||
"$ref": "#/components/schemas/TopicListResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1534,10 +1531,7 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/UserSettings"
|
||||
},
|
||||
"type": "array"
|
||||
"$ref": "#/components/schemas/UserSettings"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -10110,6 +10104,20 @@
|
||||
"type": "object",
|
||||
"x-go-package": "gitea.dev/modules/structs"
|
||||
},
|
||||
"TopicListResponse": {
|
||||
"description": "TopicListResponse returns a list of TopicResponse",
|
||||
"properties": {
|
||||
"topics": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/TopicResponse"
|
||||
},
|
||||
"type": "array",
|
||||
"x-go-name": "Topics"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"x-go-package": "gitea.dev/modules/structs"
|
||||
},
|
||||
"TopicName": {
|
||||
"description": "TopicName a list of repo topic names",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user