Skip to content

Commit

Permalink
schema: Allow *Resource as Elem of TypeMap in validation (#12722)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Mar 15, 2017
1 parent ffc5a06 commit 1df1c21
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helper/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 1df1c21

Please sign in to comment.