Skip to content

Commit

Permalink
#15: Fix validation error in BuildAPIRequest function
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger12 committed Dec 12, 2023
1 parent c444b0f commit 662f4bf
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions pkg/buildAPIRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package pkg
import (
"errors"
"github.com/go-playground/validator/v10"
"fmt"
)

// Create a new validator instance
Expand Down Expand Up @@ -40,14 +41,8 @@ func BuildAPIRequest(provider string, params map[string]string, mode string, con
err := validate.Struct(providerConfig)
if err != nil {
// Handle validation error
return nil, err
return nil, fmt.Errorf("validation error: %v", err)
}


}

// For now, return providerConfig and nil error to satisfy the function signature
// If everything is fine, return the providerConfig and nil error
return providerConfig, nil


}
}

0 comments on commit 662f4bf

Please sign in to comment.