-
Proposal:
Hide
Allow that Single and Double can be represented as JSON number, except for "NaN", "INF" and "-INF" which must be encoded as JSON strings.
Also clarify use of these string values (from ABNF) in Atom, and include examples in both.
Show
Allow that Single and Double can be represented as JSON number, except for "NaN", "INF" and "-INF" which must be encoded as JSON strings.
Also clarify use of these string values (from ABNF) in Atom, and include examples in both.
-
Resolution:
Show
Accepted: https://www.oasis-open.org/committees/download.php/49055/odata-meeting-35_on-20130502-minutes.html#odata-286
According to odata-json-format-v4.0-wd01-2013-03-05-RH.doc (section 4.1.1)
Values of types Byte, SByte, Int16, Int32, Single, and Double are represented as JSON numbers.
but that does not account for NaN, Infinity and -Infinity.
Now the ABNF (odata-abnf-construction-rules-v4.0-wd01.html) states that these values can be encoded as: 'NaN', 'INF' and '-INF'.
However I understood that the ABNF rules are applicable to values in URLs, not in JSON (unless explicitly stated in the JSON doc, as is the case with geo types).
Also note that the ABNF allows Double values to end with "d", and Single values to end with "f".
Here then, we see an apparent contradiction. NaN, INF, -INF, Double values ending with "d", and Single values ending with "f" are permitted by the ABNF rules, but not permitted in a JSON number.
The JSON spec (http://www.ietf.org/rfc/rfc4627.txt) section 2.4 quite clearly states:
Numeric values that cannot be represented as sequences of digits
(such as Infinity and NaN) are not permitted.
{"report":{"apdex":1,"isInitial":true,"journeyId":"79ebd5bd-79ca-47b6-9a64-e864e48d71bf","key":"jira.project.issue.view-issue","navigationType":0,"readyForUser":809.2999997138977,"redirectCount":0,"resourceLoadedEnd":684.5,"resourceLoadedStart":236.7999997138977,"resourceTiming":[{"duration":182.30000019073486,"initiatorType":"link","name":"https://issues.oasis-open.org/s/3edeca31ab9ba77980aae0809fbe7121-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/css/_super/batch.css","startTime":236.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":236.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":419.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":182.2999997138977,"initiatorType":"link","name":"https://issues.oasis-open.org/s/7d2823769c2e7b66e860863fe879b7f8-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/css/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&richediton=true","startTime":237.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":237.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":419.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":182.2000002861023,"initiatorType":"link","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.css","startTime":237.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":237.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":419.5,"responseStart":0,"secureConnectionStart":0},{"duration":182.09999990463257,"initiatorType":"link","name":"https://issues.oasis-open.org/s/645acc233eb869f48a571293b8358a7d-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static-adgs/jira.webresources:global-static-adgs.css","startTime":237.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":237.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":419.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":182,"initiatorType":"link","name":"https://issues.oasis-open.org/s/a0dd6509771c1de0667aae5429c04cda-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static/jira.webresources:global-static.css","startTime":237.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":237.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":419.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":220.39999961853027,"initiatorType":"script","name":"https://issues.oasis-open.org/s/e5479157e7a0c08b005e6522f2f04104-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/js/_super/batch.js?locale=en-US","startTime":238,"connectEnd":238,"connectStart":238,"domainLookupEnd":238,"domainLookupStart":238,"fetchStart":238,"redirectEnd":0,"redirectStart":0,"requestStart":238,"responseEnd":458.3999996185303,"responseStart":458.3999996185303,"secureConnectionStart":238},{"duration":233.09999990463257,"initiatorType":"script","name":"https://issues.oasis-open.org/s/83514d5d4e8543747b02042eafcdc99c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/js/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":238.5,"connectEnd":238.5,"connectStart":238.5,"domainLookupEnd":238.5,"domainLookupStart":238.5,"fetchStart":238.5,"redirectEnd":0,"redirectStart":0,"requestStart":238.5,"responseEnd":471.59999990463257,"responseStart":471.59999990463257,"secureConnectionStart":238.5},{"duration":235.09999990463257,"initiatorType":"script","name":"https://issues.oasis-open.org/s/70bb2263e59e7e1f04fbd137c80b895b-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/aae1242f5fc81cc6a5bb8bc963ccda29/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en-US","startTime":238.7999997138977,"connectEnd":238.7999997138977,"connectStart":238.7999997138977,"domainLookupEnd":238.7999997138977,"domainLookupStart":238.7999997138977,"fetchStart":238.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":238.7999997138977,"responseEnd":473.8999996185303,"responseStart":473.8999996185303,"secureConnectionStart":238.7999997138977},{"duration":235.30000019073486,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":238.89999961853027,"connectEnd":238.89999961853027,"connectStart":238.89999961853027,"domainLookupEnd":238.89999961853027,"domainLookupStart":238.89999961853027,"fetchStart":238.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":238.89999961853027,"responseEnd":474.19999980926514,"responseStart":474.19999980926514,"secureConnectionStart":238.89999961853027},{"duration":235.59999990463257,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":239.09999990463257,"connectEnd":239.09999990463257,"connectStart":239.09999990463257,"domainLookupEnd":239.09999990463257,"domainLookupStart":239.09999990463257,"fetchStart":239.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":239.09999990463257,"responseEnd":474.69999980926514,"responseStart":474.59999990463257,"secureConnectionStart":239.09999990463257},{"duration":235.7000002861023,"initiatorType":"script","name":"https://issues.oasis-open.org/s/cda37faab827dbdf305de8efe8282062-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.js?locale=en-US","startTime":239.2999997138977,"connectEnd":239.2999997138977,"connectStart":239.2999997138977,"domainLookupEnd":239.2999997138977,"domainLookupStart":239.2999997138977,"fetchStart":239.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":239.2999997138977,"responseEnd":475,"responseStart":475,"secureConnectionStart":239.2999997138977},{"duration":236,"initiatorType":"link","name":"https://issues.oasis-open.org/s/07245784f53abc49bad9d9d4d36c577a-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/cadc4f20cc5c138dee060d42cf85f220/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":239.39999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":239.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":475.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":235.89999961853027,"initiatorType":"script","name":"https://issues.oasis-open.org/rest/api/1.0/shortcuts/803004/a29179d70fa8562374ee16707692af77/shortcuts.js?context=issuenavigation&context=issueaction","startTime":239.5,"connectEnd":239.5,"connectStart":239.5,"domainLookupEnd":239.5,"domainLookupStart":239.5,"fetchStart":239.5,"redirectEnd":0,"redirectStart":0,"requestStart":239.5,"responseEnd":475.3999996185303,"responseStart":475.3999996185303,"secureConnectionStart":239.5},{"duration":207.59999990463257,"initiatorType":"link","name":"https://issues.oasis-open.org/s/f77fd89aa211a76b20e9b0e63564383c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.css?jira.create.linked.issue=true&richediton=true","startTime":268.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":476.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":207.7000002861023,"initiatorType":"script","name":"https://issues.oasis-open.org/s/41525c48ddceeb9b11e54085268fc285-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.js?jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":268.8999996185303,"connectEnd":268.8999996185303,"connectStart":268.8999996185303,"domainLookupEnd":268.8999996185303,"domainLookupStart":268.8999996185303,"fetchStart":268.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":268.8999996185303,"responseEnd":476.59999990463257,"responseStart":476.59999990463257,"secureConnectionStart":268.8999996185303},{"duration":305.19999980926514,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":278.09999990463257,"connectEnd":278.09999990463257,"connectStart":278.09999990463257,"domainLookupEnd":278.09999990463257,"domainLookupStart":278.09999990463257,"fetchStart":278.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":278.09999990463257,"responseEnd":583.2999997138977,"responseStart":583.2999997138977,"secureConnectionStart":278.09999990463257},{"duration":384.5,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":300,"connectEnd":300,"connectStart":300,"domainLookupEnd":300,"domainLookupStart":300,"fetchStart":300,"redirectEnd":0,"redirectStart":0,"requestStart":300,"responseEnd":684.5,"responseStart":684.5,"secureConnectionStart":300},{"duration":99.09999990463257,"initiatorType":"xmlhttprequest","name":"https://issues.oasis-open.org/rest/webResources/1.0/resources","startTime":660.5,"connectEnd":660.5,"connectStart":660.5,"domainLookupEnd":660.5,"domainLookupStart":660.5,"fetchStart":660.5,"redirectEnd":0,"redirectStart":0,"requestStart":660.5,"responseEnd":759.5999999046326,"responseStart":759.5999999046326,"secureConnectionStart":660.5}],"threshold":1000,"fetchStart":0,"domainLookupStart":127,"domainLookupEnd":127,"connectStart":127,"connectEnd":178,"secureConnectionStart":153,"requestStart":178,"responseStart":229,"responseEnd":300,"domLoading":232,"domInteractive":883,"domContentLoadedEventStart":883,"domContentLoadedEventEnd":928,"domComplete":1082,"loadEventStart":1082,"loadEventEnd":1084,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[],"measures":[],"correlationId":"702c6c10f2622a","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":83,"dbReadsTimeInMs":12,"dbConnsTimeInMs":15,"applicationHash":"4d4040e0714d65b7fffa4801569d014c0b16eaa9","experiments":[]}}
Trailing "d" and "f" are already disallowed in JSON as the specification explicitly refers to the JSON number representation.
The representation of other primitive types in JSON refer to ABNF rules following the pattern xxxBody, but singleBody and doubleBody are not referenced in the JSON spec. To avoid possible future misunderstandings I moved the nanInfinity alternative to the rules single and double in ABNF revision 223.
I hesitate to use string literals for representing NaN, INF and -INF in JSON payloads, making single and double properties sometimes string-valued.