Skip to content

Commit

Permalink
fix: Value and default for object CF are not lists
Browse files Browse the repository at this point in the history
  • Loading branch information
amhn authored and smutel committed May 23, 2023
1 parent e7c882c commit d3b2316
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ func testAccCheckNetboxExtrasCustomFieldObjectConfig(nameSuffix string, resource
weight = 50
#required = true
filter_logic = "disabled"
default = jsonencode([
default = jsonencode(
netbox_dcim_platform.test.id
])
)
{{ end }}
}
`
Expand Down
2 changes: 1 addition & 1 deletion netbox/internal/customfield/customfield.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func ConvertCustomFieldsFromTerraformToAPI(stateCustomFields []interface{}, cust
toReturn[cfName] = jsonList
case customFieldObject:
cfValueInt, _ := strconv.Atoi(cfValue)
toReturn[cfName] = []int{cfValueInt}
toReturn[cfName] = cfValueInt
case customFieldMultiObject:
var jsonList []interface{}
err := json.Unmarshal([]byte(cfValue), &jsonList)
Expand Down

0 comments on commit d3b2316

Please sign in to comment.