mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-26 06:04:46 +00:00
update swagger
This commit is contained in:
parent
7455b96a2f
commit
d4ca763832
4 changed files with 55 additions and 7 deletions
|
@ -13,3 +13,12 @@ type DispatchWorkflowOption struct {
|
||||||
// Input keys and values configured in the workflow file.
|
// Input keys and values configured in the workflow file.
|
||||||
Inputs map[string]string `json:"inputs"`
|
Inputs map[string]string `json:"inputs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DispatchWorkflowRun represents a workflow run
|
||||||
|
// swagger:model
|
||||||
|
type DispatchWorkflowRun struct {
|
||||||
|
// the workflow run id
|
||||||
|
ID int64 `json:"id"`
|
||||||
|
// the jobs name
|
||||||
|
Jobs []string `json:"jobs"`
|
||||||
|
}
|
||||||
|
|
|
@ -612,11 +612,6 @@ func ListActionTasks(ctx *context.APIContext) {
|
||||||
ctx.JSON(http.StatusOK, &res)
|
ctx.JSON(http.StatusOK, &res)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActionRun struct {
|
|
||||||
ID int64
|
|
||||||
Jobs []string
|
|
||||||
}
|
|
||||||
|
|
||||||
// DispatchWorkflow dispatches a workflow
|
// DispatchWorkflow dispatches a workflow
|
||||||
func DispatchWorkflow(ctx *context.APIContext) {
|
func DispatchWorkflow(ctx *context.APIContext) {
|
||||||
// swagger:operation POST /repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches repository DispatchWorkflow
|
// swagger:operation POST /repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches repository DispatchWorkflow
|
||||||
|
@ -644,7 +639,11 @@ func DispatchWorkflow(ctx *context.APIContext) {
|
||||||
// in: body
|
// in: body
|
||||||
// schema:
|
// schema:
|
||||||
// "$ref": "#/definitions/DispatchWorkflowOption"
|
// "$ref": "#/definitions/DispatchWorkflowOption"
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
// responses:
|
// responses:
|
||||||
|
// "201":
|
||||||
|
// "$ref": "#/responses/DispatchWorkflowRun"
|
||||||
// "204":
|
// "204":
|
||||||
// "$ref": "#/responses/empty"
|
// "$ref": "#/responses/empty"
|
||||||
// "404":
|
// "404":
|
||||||
|
@ -685,10 +684,10 @@ func DispatchWorkflow(ctx *context.APIContext) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
actionRun := &ActionRun{
|
workflowRun := &api.DispatchWorkflowRun{
|
||||||
ID: run.ID,
|
ID: run.ID,
|
||||||
Jobs: jobs,
|
Jobs: jobs,
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.JSON(http.StatusOK, actionRun)
|
ctx.JSON(http.StatusCreated, workflowRun)
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,3 +39,10 @@ type swaggerRunJobList struct {
|
||||||
// in:body
|
// in:body
|
||||||
Body []*api.ActionRunJob `json:"body"`
|
Body []*api.ActionRunJob `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DispatchWorkflowRun is a Workflow Run after dispatching
|
||||||
|
// swagger:response DispatchWorkflowRun
|
||||||
|
type swaggerDispatchWorkflowRun struct {
|
||||||
|
// in:body
|
||||||
|
Body *api.DispatchWorkflowRun `json:"body"`
|
||||||
|
}
|
||||||
|
|
33
templates/swagger/v1_json.tmpl
generated
33
templates/swagger/v1_json.tmpl
generated
|
@ -5378,6 +5378,9 @@
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"repository"
|
"repository"
|
||||||
],
|
],
|
||||||
|
@ -5414,6 +5417,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"$ref": "#/responses/DispatchWorkflowRun"
|
||||||
|
},
|
||||||
"204": {
|
"204": {
|
||||||
"$ref": "#/responses/empty"
|
"$ref": "#/responses/empty"
|
||||||
},
|
},
|
||||||
|
@ -23132,6 +23138,27 @@
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
},
|
},
|
||||||
|
"DispatchWorkflowRun": {
|
||||||
|
"description": "DispatchWorkflowRun represents a workflow run",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "the workflow run id",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "ID"
|
||||||
|
},
|
||||||
|
"jobs": {
|
||||||
|
"description": "the jobs name",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"x-go-name": "Jobs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
"EditAttachmentOptions": {
|
"EditAttachmentOptions": {
|
||||||
"description": "EditAttachmentOptions options for editing attachments",
|
"description": "EditAttachmentOptions options for editing attachments",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -28511,6 +28538,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"DispatchWorkflowRun": {
|
||||||
|
"description": "DispatchWorkflowRun is a Workflow Run after dispatching",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/DispatchWorkflowRun"
|
||||||
|
}
|
||||||
|
},
|
||||||
"EmailList": {
|
"EmailList": {
|
||||||
"description": "EmailList",
|
"description": "EmailList",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
|
Loading…
Reference in a new issue