1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-04 00:34:39 +00:00

Refactor types

This commit is contained in:
Darren Shepherd
2017-11-29 14:27:02 -07:00
parent ee148b4d18
commit 15e105a0ab
15 changed files with 89 additions and 43 deletions

View File

@@ -113,6 +113,10 @@ func (b *Builder) checkDefaultAndRequired(schema *types.Schema, input map[string
}
}
}
if op == List && fieldMatchesOp(field, List) && definition.IsReferenceType(field.Type) && !hasKey {
result[fieldName] = nil
}
}
return nil
@@ -264,7 +268,7 @@ func (b *Builder) convertReferenceType(fieldType string, value interface{}) (str
func (b *Builder) convertArray(fieldType string, value interface{}, op Operation) ([]interface{}, error) {
if strSliceValue, ok := value.([]string); ok {
// Form data will be []string
result := []interface{}{}
var result []interface{}
for _, value := range strSliceValue {
result = append(result, value)
}