Skip to content

Commit d88d6c7

Browse files
committed
Permit nested id_attributes
1 parent 5745cb7 commit d88d6c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

restapi/datasource_api_object.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ func dataSourceRestApiRead(d *schema.ResourceData, meta interface{}) error {
148148

149149
/* We found our record */
150150
if tmp == search_value {
151-
id = fmt.Sprintf("%v", hash[id_attribute])
151+
id, err = GetStringAtKey(hash, id_attribute, debug)
152+
if err != nil {
153+
return(fmt.Errorf("Failed to find id_attribute '%s' in the record: %s", id_attribute, err))
154+
}
155+
152156
if debug { log.Printf("datasource_api_object.go: Found ID %s", id) }
153157

154158
/* But there is no id attribute??? */

0 commit comments

Comments
 (0)