Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  05 Apr 2013, Konstantin Olchanski, Info, ODB JSON support 
    Reply  10 May 2013, Konstantin Olchanski, Info, mhttpd JSON support 
       Reply  17 May 2013, Konstantin Olchanski, Info, mhttpd JSON-P support 
          Reply  31 May 2013, Konstantin Olchanski, Info, mhttpd JSON-P support 
    Reply  27 Sep 2013, Konstantin Olchanski, Info, ODB JSON support 
       Reply  09 Oct 2013, Konstantin Olchanski, Info, ODB JSON support 
          Reply  17 Mar 2014, Konstantin Olchanski, Info, ODB JSON support 
             Reply  12 Apr 2022, Konstantin Olchanski, Info, ODB JSON support 
                Reply  13 Apr 2022, Stefan Ritt, Info, ODB JSON support 
                   Reply  13 Apr 2022, Konstantin Olchanski, Info, ODB JSON support 
Message ID: 988     Entry time: 17 Mar 2014     In reply to: 918     Reply to this: 2382
Author: Konstantin Olchanski 
Topic: Info 
Subject: ODB JSON support 
> > > odbedit can now save ODB in JSON-formatted files.
> encode NaN, Inf and -Inf as JSON string values "NaN", "Infinity" and "-Infinity". (Corresponding to the respective Javascript values).

A new standard just came out - Oasis OData JSON format 4.0 - 
http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html

Section 7.1 reads:

> Values of types [...] Edm.Single, Edm.Double, and Edm.Decimal are represented as JSON numbers, except for NaN, INF, and –INF which are represented as strings.

This is consistent with what we do in MIDAS - encode special numbers as strings. For now I think we stay with Javascript-standard "Infinity", "-Infinity",
but if more standards start using "INF", "-INF", maybe we will switch. It is easy enough to support both encodings in the JSON parser and in the ODB decoder.

https://xkcd.com/927/
K.O.
ELOG V3.1.4-2e1708b5