简体   繁体   中英

Why IBM Watson Assistant Complex object properties do not update?

According to the documentation "If the context variable is a complex type such as JSON object, a JSON merge procedure is used to update the variable. The merge operation adds any newly defined properties and overwrites any existing properties of the object." . but when I try that it does not work.

Code in a node:

    "context": {
         "comp_obj": "{a:1,b:2}" 
  }

Code in the very next node:

    "context": {
        "comp_obj": "{a:3}"
  }

But when I check values with Manage Context it shows $comp_obj = "{a:3}" and not "{a:3, b:2}" , So do I miss something?

The issue is that you have defined your value as a string not a JSON object.

Change: "{a:1,b:2}" to: {"a":1, "b":2} and it should work fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM