Skip to content

Commit

Permalink
Permit nested id_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
DRuggeri committed Oct 26, 2018
1 parent 5745cb7 commit d88d6c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion restapi/datasource_api_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ func dataSourceRestApiRead(d *schema.ResourceData, meta interface{}) error {

/* We found our record */
if tmp == search_value {
id = fmt.Sprintf("%v", hash[id_attribute])
id, err = GetStringAtKey(hash, id_attribute, debug)
if err != nil {
return(fmt.Errorf("Failed to find id_attribute '%s' in the record: %s", id_attribute, err))
}

if debug { log.Printf("datasource_api_object.go: Found ID %s", id) }

/* But there is no id attribute??? */
Expand Down

0 comments on commit d88d6c7

Please sign in to comment.