mirror of
https://github.com/rancher/norman.git
synced 2025-07-31 23:00:43 +00:00
Add type before and after
This commit is contained in:
parent
c032c4611f
commit
d985e01035
@ -82,12 +82,18 @@ func (t *typeMapper) FromInternal(data map[string]interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt to set type so mappers are aware of it
|
||||
if _, ok := data["type"]; !ok && data != nil {
|
||||
data["type"] = t.typeName
|
||||
}
|
||||
|
||||
Mappers(t.Mappers).FromInternal(data)
|
||||
|
||||
// Ensure if there is no type we set one
|
||||
if _, ok := data["type"]; !ok && data != nil {
|
||||
data["type"] = t.typeName
|
||||
}
|
||||
|
||||
if data != nil && t.root {
|
||||
if _, ok := data["id"]; ok {
|
||||
if namespace != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user