diff --git a/models/projects.go b/models/projects.go index 66a1eb5..f187e9f 100644 --- a/models/projects.go +++ b/models/projects.go @@ -49,7 +49,7 @@ type ProjectsBodyResponses struct { } `json:"cve_allowlist"` Metadata struct { EnableContentTrust string `json:"enable_content_trust"` - AutoScan string `json:"auto_scan"` + AutoScan string `json:"auto_scan,omitempty"` Severity string `json:"severity"` ReuseSysCveAllowlist string `json:"reuse_sys_cve_allowlist"` Public string `json:"public"` diff --git a/provider/data_project.go b/provider/data_project.go index 25e3b6f..d2ca6cb 100644 --- a/provider/data_project.go +++ b/provider/data_project.go @@ -58,9 +58,16 @@ func dataProjectRead(d *schema.ResourceData, m interface{}) error { if err != nil { return err } - autoScan, err := strconv.ParseBool(v.Metadata.AutoScan) - if err != nil { - return err + + var autoScan bool + scan := v.Metadata.AutoScan + if scan == "" { + autoScan = false + } else { + autoScan, err = strconv.ParseBool(scan) + if err != nil { + return err + } } d.SetId(id)