mirror of
https://github.com/rancher/norman.git
synced 2025-08-11 20:21:41 +00:00
don't return nonnullable error if default is set
This commit is contained in:
parent
d4e7ad28b8
commit
409b391766
@ -162,7 +162,9 @@ func checkFieldCriteria(fieldName string, field types.Field, value interface{})
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (value == nil || value == "") && !field.Nullable {
|
if (value == nil || value == "") && !field.Nullable {
|
||||||
return httperror.NewFieldAPIError(httperror.NotNullable, fieldName, "")
|
if field.Default == nil {
|
||||||
|
return httperror.NewFieldAPIError(httperror.NotNullable, fieldName, "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if isNum {
|
if isNum {
|
||||||
|
Loading…
Reference in New Issue
Block a user