My app receives JSON data via makeWebRequest(), which includes numeric values such as "step": 5.
In all of my testing across multiple devices in the simulator and on my own Epix 2 Pro, these values are consistently delivered by the API as Number. However, I have received user reports and corresponding ERA errors indicating that, in other environments, the same values are provided as Float.
After further analysis, it appears that the exact same JSON payload can result in different numeric types (Number vs. Float) depending on the device or runtime environment. So far, I have not been able to identify what conditions cause the API to choose one representation over the other.
I could not find any documentation that describes how the API parses JSON numeric values or under which circumstances it returns Number versus Float.
I would therefore appreciate clarification on the expected behavior of the JSON parser, including:
-
How numeric values in JSON are mapped to Connect IQ types
-
What factors (device, firmware, platform, etc.) may influence this behavior
-
Whether developers should always expect and handle both
NumberandFloat
Any guidance on this would be very helpful.
-
the-ninth
-
Cancel
-
Vote Up
+1
Vote Down
-
-
More
-
Cancel
Comment-
the-ninth
-
Cancel
-
Vote Up
+1
Vote Down
-
-
More
-
Cancel
Children