-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_OS
-
Fix Version/s: V4.0_ERRATA01
-
Component/s: JSON Format
-
Labels:None
-
Environment:
[Proposed][Applied]
-
Proposal:
Section 4.5.3 says
Numeric values have a first-class representation in JSON and do not need any additional annotations. If the value of a property is represented as a number without a dot (.), e or E embedded, the type should be interpreted as an integer value, otherwise as a decimal, double, or single value.
Unfortunately this type inference does not work for clients using generic JSON parsers, e.g. JSON.parse() in JavaScript. The lines
var payload = '
{ "x" : 1.2e4 }';
var parsed = JSON.parse(payload);
console.log(parsed.x);
will result in 12000.