Skip to content

Commit

Permalink
fix: error when passing an enum to a string param (#259)
Browse files Browse the repository at this point in the history
Co-authored-by: Charles Francoise <[email protected]>
  • Loading branch information
abdelDriowya and loderunner authored Dec 1, 2023
1 parent 439f468 commit 23019c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/parser/validate/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ func (val Validate) checkParamUsedWithParam(param ast.ParameterValue, stepName s
// check already done before in `CheckIfParamsExist`
return
}

if paramUsedAsValue.GetType() != definedParam.GetType() {
definedType := definedParam.GetType()
valueType := paramUsedAsValue.GetType()
if definedType != valueType && !(definedType == "string" && valueType == "enum") { // String params can accept "string" or "enum"
val.createParameterError(param, stepName, definedParam.GetType())
}
}
Expand Down

0 comments on commit 23019c3

Please sign in to comment.