Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
DESCRIPTION:
Thingworx service does not complete if getting a json element whose key contains only digits.
STEPS TO REPRODUCE:
1. Define `test` as a JSON property of a thing
2. Run the following service
me.test = {"123": "456"}
me.test["123"]
// Java class "org.json.JSONObject" has no public instance field or method named "123"
JSON.parse(JSON.stringify(me.test))["123"]
// Works (workaround)
ERROR MESSAGE:
Java class "org.json.JSONObject" has no public instance field or method named "123"
VERSION
9.1.5-b698
I'm submitting the bug report here since there is a paywall on the contact us support page and this might be a big issue since it is interpretting the text of the key of the json object as code (or at least as a literal).
Solved! Go to Solution.
Hi @BP_9999767.
A fix for this issue was delivered in ThingWorx 9.4 which is now available for download.
Regards.
--Sharon
Hi,
The error you are experiencing was also discussed in the following thread - "How to convert infoTable to json?": https://community.ptc.com/t5/ThingWorx-Developers/How-to-convert-infoTable-to-json/td-p/520804
Hi @BP_9999767.
We tested and were able to recreate the issue. We also found that we have an open bug report on this. I am following up for a status and will post it here once I receive more information.
Regards.
--Sharon
Hi @BP_9999767.
A fix for this issue was delivered in ThingWorx 9.4 which is now available for download.
Regards.
--Sharon