From 393a91f24c6cd17965e58a25b7b25a404df8f598 Mon Sep 17 00:00:00 2001 From: ish Date: Mon, 7 Oct 2024 17:24:39 +0900 Subject: [PATCH] pkg: api: rest: Add operation IDs to new APIs --- pkg/api/rest/controller/workflow.go | 9 +++++++-- pkg/api/rest/docs/docs.go | 7 ++++++- pkg/api/rest/docs/swagger.json | 7 ++++++- pkg/api/rest/docs/swagger.yaml | 7 ++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/pkg/api/rest/controller/workflow.go b/pkg/api/rest/controller/workflow.go index 0e87fb5..da174e6 100644 --- a/pkg/api/rest/controller/workflow.go +++ b/pkg/api/rest/controller/workflow.go @@ -883,6 +883,7 @@ func GetTaskDirectly(c echo.Context) error { // GetTaskLogs godoc // +// @ID get-task-logs // @Summary Get Task Logs // @Description Get the task Logs. // @Tags [Workflow] @@ -937,6 +938,7 @@ func GetTaskLogs(c echo.Context) error { // GetWorkflowRuns godoc // +// @ID get-workflow // @Summary Get workflowRuns // @Description Get the task Logs. // @Tags [Workflow] @@ -982,6 +984,7 @@ func GetWorkflowRuns(c echo.Context) error { // GetTaskInstances godoc // +// @ID get-task-instances // @Summary Get taskInstances // @Description Get the task Logs. // @Tags [Workflow] @@ -1047,8 +1050,9 @@ func GetTaskInstances(c echo.Context) error { return c.JSONPretty(http.StatusOK, taskInstances, " ") } -// taskInstances godoc +// ClearTaskInstances godoc // +// @ID clear-task-instances // @Summary Clear taskInstances // @Description Clear the task Instance. // @Tags [Workflow] @@ -1107,7 +1111,7 @@ func ClearTaskInstances(c echo.Context) error { // GetEventLogs godoc // -// @ID get-Eventlog +// @ID get-event-logs // @Summary Get Eventlog // @Description Get Eventlog. // @Tags [Workflow] @@ -1172,6 +1176,7 @@ func GetEventLogs(c echo.Context) error { // GetImportErrors godoc // +// @ID get-import-errors // @Summary Get importErrors // @Description Get the importErrors. // @Tags [Workflow] diff --git a/pkg/api/rest/docs/docs.go b/pkg/api/rest/docs/docs.go index f5ea375..3cb21ac 100644 --- a/pkg/api/rest/docs/docs.go +++ b/pkg/api/rest/docs/docs.go @@ -32,7 +32,7 @@ const docTemplate = `{ "[Workflow]" ], "summary": "Get Eventlog", - "operationId": "get-Eventlog", + "operationId": "get-event-logs", "parameters": [ { "type": "string", @@ -92,6 +92,7 @@ const docTemplate = `{ "[Workflow]" ], "summary": "Get importErrors", + "operationId": "get-import-errors", "responses": { "200": { "description": "Successfully get the importErrors.", @@ -864,6 +865,7 @@ const docTemplate = `{ "[Workflow]" ], "summary": "Get workflowRuns", + "operationId": "get-workflow", "parameters": [ { "type": "string", @@ -1225,6 +1227,7 @@ const docTemplate = `{ "[Workflow]" ], "summary": "Clear taskInstances", + "operationId": "clear-task-instances", "parameters": [ { "type": "string", @@ -1283,6 +1286,7 @@ const docTemplate = `{ "[Workflow]" ], "summary": "Get Task Logs", + "operationId": "get-task-logs", "parameters": [ { "type": "string", @@ -1348,6 +1352,7 @@ const docTemplate = `{ "[Workflow]" ], "summary": "Get taskInstances", + "operationId": "get-task-instances", "parameters": [ { "type": "string", diff --git a/pkg/api/rest/docs/swagger.json b/pkg/api/rest/docs/swagger.json index 1be5554..3cdc84c 100644 --- a/pkg/api/rest/docs/swagger.json +++ b/pkg/api/rest/docs/swagger.json @@ -25,7 +25,7 @@ "[Workflow]" ], "summary": "Get Eventlog", - "operationId": "get-Eventlog", + "operationId": "get-event-logs", "parameters": [ { "type": "string", @@ -85,6 +85,7 @@ "[Workflow]" ], "summary": "Get importErrors", + "operationId": "get-import-errors", "responses": { "200": { "description": "Successfully get the importErrors.", @@ -857,6 +858,7 @@ "[Workflow]" ], "summary": "Get workflowRuns", + "operationId": "get-workflow", "parameters": [ { "type": "string", @@ -1218,6 +1220,7 @@ "[Workflow]" ], "summary": "Clear taskInstances", + "operationId": "clear-task-instances", "parameters": [ { "type": "string", @@ -1276,6 +1279,7 @@ "[Workflow]" ], "summary": "Get Task Logs", + "operationId": "get-task-logs", "parameters": [ { "type": "string", @@ -1341,6 +1345,7 @@ "[Workflow]" ], "summary": "Get taskInstances", + "operationId": "get-task-instances", "parameters": [ { "type": "string", diff --git a/pkg/api/rest/docs/swagger.yaml b/pkg/api/rest/docs/swagger.yaml index 17658a1..9989410 100644 --- a/pkg/api/rest/docs/swagger.yaml +++ b/pkg/api/rest/docs/swagger.yaml @@ -397,7 +397,7 @@ paths: consumes: - application/json description: Get Eventlog. - operationId: get-Eventlog + operationId: get-event-logs parameters: - description: ID of the workflow. in: query @@ -437,6 +437,7 @@ paths: consumes: - application/json description: Get the importErrors. + operationId: get-import-errors produces: - application/json responses: @@ -922,6 +923,7 @@ paths: consumes: - application/json description: Get the task Logs. + operationId: get-workflow parameters: - description: ID of the workflow. in: path @@ -1164,6 +1166,7 @@ paths: consumes: - application/json description: Clear the task Instance. + operationId: clear-task-instances parameters: - description: ID of the workflow. in: path @@ -1203,6 +1206,7 @@ paths: consumes: - application/json description: Get the task Logs. + operationId: get-task-logs parameters: - description: ID of the workflow. in: path @@ -1247,6 +1251,7 @@ paths: consumes: - application/json description: Get the task Logs. + operationId: get-task-instances parameters: - description: ID of the workflow. in: path