schema: Allow *Resource as Elem of TypeMap in validation (#12722)

This commit is contained in:
Radek Simko 2017-03-15 14:54:41 +00:00 committed by GitHub
parent ffc5a06cb5
commit 1df1c21d5b
1 changed files with 7 additions and 0 deletions

View File

@ -1357,6 +1357,13 @@ func getValueType(k string, schema *Schema) (ValueType, error) {
return vt, nil
}
}
if _, ok := schema.Elem.(*Resource); ok {
// TODO: We don't actually support this (yet)
// but silently pass the validation, until we decide
// how to handle nested structures in maps
return TypeString, nil
}
return 0, fmt.Errorf("%s: unexpected map value type: %#v", k, schema.Elem)
}