Map interface{} RPC projections correctly

A property whose type is `interface{}` in the IDL ought to be projected
as a "JSON-like" map, just like it is on the Coconut package side of things,
which means a `map[string]interface{}`.
This commit is contained in:
joeduffy 2017-04-28 10:58:27 -07:00
parent 72b4035f3a
commit 75a897c23f

View file

@ -454,7 +454,8 @@ func (g *RPCGenerator) GenTypeName(t types.Type) string {
contract.Failf("Unrecognized GenTypeName basic type: %v", k)
}
case *types.Interface:
return "resource.PropertyMap"
// interface{} properties become "JSON-like" maps.
return "map[string]interface{}"
case *types.Named:
obj := u.Obj()
// For resource types, simply emit an ID, since that is what will have been serialized.