Skip to content

Commit

Permalink
fix types in manual api but tests still broken
Browse files Browse the repository at this point in the history
  • Loading branch information
lucamrgs committed Jan 16, 2025
1 parent f64301c commit 4c14bbb
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions pkg/api/manual/manual_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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()
Expand All @@ -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) {
Expand Down Expand Up @@ -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]
Expand All @@ -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")
Expand Down

0 comments on commit 4c14bbb

Please sign in to comment.