Skip to content

Commit

Permalink
add Int64 support in GenerateQueryParamString
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz committed Nov 24, 2024
1 parent 9bd553c commit 2ef8f61
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,18 @@ func GenerateQueryParamString(method string, inputSource string, attributes []Ya
// Construct the query parameter string if includeParam is true
if includeParam {
if first {
params = append(params, `"?`+queryParamName+`=" + url.QueryEscape(`+inputSource+`.`+ToGoName(attr.TfName)+`.Value`+attr.Type+`())`)
if attr.Type == "Int64" {
params = append(params, `"?`+queryParamName+`=" + url.QueryEscape(strconv.FormatInt(`+inputSource+`.`+ToGoName(attr.TfName)+`.Value`+attr.Type+`(), 10))`)
} else {
params = append(params, `"?`+queryParamName+`=" + url.QueryEscape(`+inputSource+`.`+ToGoName(attr.TfName)+`.Value`+attr.Type+`())`)
}
first = false
} else {
params = append(params, `"&`+queryParamName+`=" + url.QueryEscape(`+inputSource+`.`+ToGoName(attr.TfName)+`.Value`+attr.Type+`())`)
if attr.Type == "Int64" {
params = append(params, `"&`+queryParamName+`=" + url.QueryEscape(strconv.FormatInt(`+inputSource+`.`+ToGoName(attr.TfName)+`.Value`+attr.Type+`(), 10))`)
} else {
params = append(params, `"&`+queryParamName+`=" + url.QueryEscape(`+inputSource+`.`+ToGoName(attr.TfName)+`.Value`+attr.Type+`())`)
}
}
}
}
Expand Down

0 comments on commit 2ef8f61

Please sign in to comment.