mirror of
https://github.com/rancher/norman.git
synced 2025-09-06 17:50:25 +00:00
Rename IsEmpty to IsAPIObjectEmpty
This commit is contained in:
@@ -108,10 +108,10 @@ func (b *Builder) copyInputs(schema *types.Schema, input map[string]interface{},
|
||||
}
|
||||
|
||||
if op.IsList() && !b.edit && !b.export {
|
||||
if !convert.IsEmpty(input["type"]) {
|
||||
if !convert.IsAPIObjectEmpty(input["type"]) {
|
||||
result["type"] = input["type"]
|
||||
}
|
||||
if !convert.IsEmpty(input["id"]) {
|
||||
if !convert.IsAPIObjectEmpty(input["id"]) {
|
||||
result["id"] = input["id"]
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ func (b *Builder) dropDefaultsAndReadOnly(schema *types.Schema, result map[strin
|
||||
continue
|
||||
}
|
||||
|
||||
if convert.IsEmpty(existingVal) {
|
||||
if convert.IsAPIObjectEmpty(existingVal) {
|
||||
delete(result, name)
|
||||
continue
|
||||
}
|
||||
|
@@ -133,7 +133,7 @@ func LowerTitle(input string) string {
|
||||
return string(runes)
|
||||
}
|
||||
|
||||
func IsEmpty(v interface{}) bool {
|
||||
func IsAPIObjectEmpty(v interface{}) bool {
|
||||
if v == nil || v == "" || v == 0 || v == false {
|
||||
return true
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ outer:
|
||||
|
||||
for _, check := range mapper.CheckFields {
|
||||
v, ok := data[check]
|
||||
if !ok || convert.IsEmpty(v) {
|
||||
if !ok || convert.IsAPIObjectEmpty(v) {
|
||||
continue outer
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user