templates: Skip validation for interface{}
Signed-off-by: Jingwen Peng <pengsrc@yunify.com>
This commit is contained in:
parent
4d932f5467
commit
c8a32f716c
|
@ -195,7 +195,7 @@
|
|||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{if eq $property.Type "object"}}
|
||||
{{if and (eq $property.Type "object") (ne $property.ExtraType "") }}
|
||||
if v.{{$property.ID | camelCase}} != nil {
|
||||
if err := v.{{$property.ID | camelCase}}.Validate(); err != nil {
|
||||
return err
|
||||
|
@ -223,7 +223,8 @@
|
|||
{{$isNotString := ne $property.ExtraType "string"}}
|
||||
{{$isNotInteger := ne $property.ExtraType "integer"}}
|
||||
{{$isNotTimestamp := ne $property.ExtraType "timestamp"}}
|
||||
{{if and $isNotString $isNotInteger $isNotTimestamp}}
|
||||
{{$isNotInterface := ne $property.ExtraType "object"}}
|
||||
{{if and $isNotString $isNotInteger $isNotTimestamp $isNotInterface}}
|
||||
if len(v.{{$property.ID | camelCase}}) > 0 {
|
||||
for _, property := range v.{{$property.ID | camelCase}} {
|
||||
if err := property.Validate(); err != nil {
|
||||
|
|
Loading…
Reference in New Issue