From 4c14bbbf32a57f1a687fe86abe63069c642f153b Mon Sep 17 00:00:00 2001 From: lucamrgs <39555424+lucamrgs@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:59:07 +0100 Subject: [PATCH] fix types in manual api but tests still broken --- pkg/api/manual/manual_api.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pkg/api/manual/manual_api.go b/pkg/api/manual/manual_api.go index 45139de5..882ef11b 100644 --- a/pkg/api/manual/manual_api.go +++ b/pkg/api/manual/manual_api.go @@ -8,7 +8,6 @@ import ( "soarca/internal/logger" "soarca/pkg/core/capability/manual/interaction" "soarca/pkg/models/api" - apiModel "soarca/pkg/models/api" "soarca/pkg/models/execution" "soarca/pkg/models/manual" @@ -59,7 +58,7 @@ func NewManualHandler(interaction interaction.IInteractionStorage) *ManualHandle // @Accept json // @Produce json // @Success 200 {object} api.Execution -// @failure 400 {object} []manual.InteractionCommandData +// @failure 400 {object} []api.InteractionCommandData // @Router /manual/ [GET] func (manualHandler *ManualHandler) GetPendingCommands(g *gin.Context) { commands, status, err := manualHandler.interactionCapability.GetPendingCommands() @@ -84,7 +83,7 @@ func (manualHandler *ManualHandler) GetPendingCommands(g *gin.Context) { // @Produce json // @Param exec_id path string true "execution ID" // @Param step_id path string true "step ID" -// @Success 200 {object} manual.InteractionCommandData +// @Success 200 {object} api.InteractionCommandData // @failure 400 {object} api.Error // @Router /manual/{exec_id}/{step_id} [GET] func (manualHandler *ManualHandler) GetPendingCommand(g *gin.Context) { @@ -120,15 +119,15 @@ func (manualHandler *ManualHandler) GetPendingCommand(g *gin.Context) { // @Tags manual // @Accept json // @Produce json -// @Param exec_id path string true "execution ID" -// @Param step_id path string true "step ID" -// @Param type body string true "type" -// @Param outArgs body string true "execution ID" -// @Param execution_id body string true "playbook ID" -// @Param playbook_id body string true "playbook ID" -// @Param step_id body string true "step ID" -// @Param response_status body string true "response status" -// @Param response_out_args body manual.ManualOutArgs true "out args" +// @Param exec_id path string true "execution ID" +// @Param step_id path string true "step ID" +// @Param type body string true "type" +// @Param outArgs body string true "execution ID" +// @Param execution_id body string true "playbook ID" +// @Param playbook_id body string true "playbook ID" +// @Param step_id body string true "step ID" +// @Param response_status body string true "response status" +// @Param response_out_args body cacao.Variables true "out args" // @Success 200 {object} api.Execution // @failure 400 {object} api.Error // @Router /manual/continue [POST] @@ -143,7 +142,7 @@ func (manualHandler *ManualHandler) PostContinue(g *gin.Context) { return } - var outArgsUpdate apiModel.ManualOutArgsUpdatePayload + var outArgsUpdate api.ManualOutArgsUpdatePayload err = json.Unmarshal(jsonData, &outArgsUpdate) if err != nil { log.Error("failed to unmarshal JSON")