diff --git a/helper/structure/structure.go b/helper/structure/structure.go index 3ebfb9ace..6ad12de62 100644 --- a/helper/structure/structure.go +++ b/helper/structure/structure.go @@ -37,6 +37,11 @@ func ExpandJsonFromString(jsonString string) (map[string]interface{}, error) { } func FlattenJsonToString(input map[string]interface{}) (string, error) { + + if len(input) == 0 { + return "", nil + } + result, err := json.Marshal(input) if err != nil { return "", err