aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScion <Filiecs2@gmail.com>2025-07-09 07:32:02 -0700
committerGitHub <noreply@github.com>2025-07-09 22:32:02 +0800
commitbb0c84e8c3254a96e44147a117ea44aa3c743598 (patch)
tree041bde9439fcc314e2a0c131b249b24cb90f0d8d
parent55f350542ce6db6621ceed987d3d11b8ab5dd2dd (diff)
downloadgitea-bb0c84e8c3254a96e44147a117ea44aa3c743598.tar.gz
gitea-bb0c84e8c3254a96e44147a117ea44aa3c743598.zip
Fix the response format for `actions/workflows`. (#35009)
This PR fixes the response format for the OpenAPI Spec of `ActionsListRepositoryWorkflows`. It was specified in the OpenAPI spec as returning a `[]*ActionWorkflow`, but it actually should return a `api.ActionWorkflowResponse`. The test already expects an `api.ActionWorkflowResponse` like expected.
-rw-r--r--routers/api/v1/swagger/action.go2
-rw-r--r--templates/swagger/v1_json.tmpl24
2 files changed, 21 insertions, 5 deletions
diff --git a/routers/api/v1/swagger/action.go b/routers/api/v1/swagger/action.go
index 16a250184a..0606505950 100644
--- a/routers/api/v1/swagger/action.go
+++ b/routers/api/v1/swagger/action.go
@@ -44,5 +44,5 @@ type swaggerResponseActionWorkflow struct {
// swagger:response ActionWorkflowList
type swaggerResponseActionWorkflowList struct {
// in:body
- Body []api.ActionWorkflow `json:"body"`
+ Body api.ActionWorkflowResponse `json:"body"`
}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 1cc3735b2b..6cf2810baf 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -21248,6 +21248,25 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ActionWorkflowResponse": {
+ "description": "ActionWorkflowResponse returns a ActionWorkflow",
+ "type": "object",
+ "properties": {
+ "total_count": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "TotalCount"
+ },
+ "workflows": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionWorkflow"
+ },
+ "x-go-name": "Workflows"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"ActionWorkflowRun": {
"description": "ActionWorkflowRun represents a WorkflowRun",
"type": "object",
@@ -28592,10 +28611,7 @@
"ActionWorkflowList": {
"description": "ActionWorkflowList",
"schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/ActionWorkflow"
- }
+ "$ref": "#/definitions/ActionWorkflowResponse"
}
},
"ActivityFeedsList": {