mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +02:00
ignore empty json fields when processing templates
This commit is contained in:
@@ -322,6 +322,9 @@ func yamlFixup(data interface{}) (interface{}, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(copy) == 0 {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return copy, nil
|
return copy, nil
|
||||||
case map[string]interface{}:
|
case map[string]interface{}:
|
||||||
copy := make(map[string]interface{})
|
copy := make(map[string]interface{})
|
||||||
@@ -332,6 +335,9 @@ func yamlFixup(data interface{}) (interface{}, error) {
|
|||||||
copy[k] = fixed
|
copy[k] = fixed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(copy) == 0 {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return copy, nil
|
return copy, nil
|
||||||
case []interface{}:
|
case []interface{}:
|
||||||
copy := make([]interface{}, 0, len(d))
|
copy := make([]interface{}, 0, len(d))
|
||||||
@@ -342,6 +348,9 @@ func yamlFixup(data interface{}) (interface{}, error) {
|
|||||||
copy = append(copy, fixed)
|
copy = append(copy, fixed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(copy) == 0 {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return copy, nil
|
return copy, nil
|
||||||
case string:
|
case string:
|
||||||
if d == "" || d == "\n" {
|
if d == "" || d == "\n" {
|
||||||
|
|||||||
Reference in New Issue
Block a user