diff --git a/pkg/server/mapper.go b/pkg/server/mapper.go index 832554a..0c2694a 100644 --- a/pkg/server/mapper.go +++ b/pkg/server/mapper.go @@ -17,10 +17,6 @@ type defaultMapper struct { } func (d *defaultMapper) FromInternal(data map[string]interface{}) { - if t, ok := data["type"]; ok { - data["_type"] = t - } - if _, ok := data["id"]; ok || data == nil { return } diff --git a/vendor/github.com/rancher/norman/pkg/types/mapper.go b/vendor/github.com/rancher/norman/pkg/types/mapper.go index cf18af3..3045bba 100644 --- a/vendor/github.com/rancher/norman/pkg/types/mapper.go +++ b/vendor/github.com/rancher/norman/pkg/types/mapper.go @@ -90,6 +90,12 @@ func (t *typeMapper) FromInternal(data map[string]interface{}) { } } + if t.root { + if _, ok := data["type"]; ok { + data["type"] = t.typeName + } + } + Mappers(t.Mappers).FromInternal(data) }