SEBA-672 model update commands
Change-Id: I7fef3a4c1ee5ccb8c33a01f37a772142a82249c1
diff --git a/commands/handler.go b/commands/handler.go
index 8aadb44..678883d 100644
--- a/commands/handler.go
+++ b/commands/handler.go
@@ -69,7 +69,15 @@
}
for k, v := range fields {
- dmsg.TrySetFieldByName(k, v)
+ // _json is a special field name that indicates we should unmarshal json data
+ if k == "_json" {
+ err = dmsg.UnmarshalMergeJSON(v.([]byte))
+ if err != nil {
+ return err
+ }
+ } else {
+ dmsg.SetFieldByName(k, v)
+ }
}
delete(h.Fields, dmsg.XXX_MessageName())