1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-02 07:44:51 +00:00

Default empty strings

This commit is contained in:
Darren Shepherd
2018-03-01 14:22:08 -07:00
parent 65e6d1cc46
commit f59a6072cf
2 changed files with 49 additions and 1 deletions

View File

@@ -88,7 +88,11 @@ func (b *Builder) copyInputs(schema *types.Schema, input map[string]interface{},
}
}
}
result[fieldName] = value
// Don't copy empty strings
if !(value == "" && field.Type == "string") {
result[fieldName] = value
}
if op.IsList() && field.Type == "date" && value != "" {
ts, err := convert.ToTimestamp(value)