EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
<== Date ==> <== Thread ==>

Subject: Re: pvget -M json is JSON5
From: "Johnson, Andrew N. via Core-talk" <core-talk at aps.anl.gov>
To: Michael Davidsaver <mdavidsaver at gmail.com>
Cc: "core-talk at aps.anl.gov" <core-talk at aps.anl.gov>
Date: Wed, 7 Feb 2024 21:56:51 +0000
If you follow the links in the PR that Michael posted you’ll see that this fix was to support NaN and Inf values which strict JSON doesn’t handle at all. 

I’d be fine with a PR that adds a flag to choose standard which you want, but adding Inf and NaN support to the JSON output would be a bit more work. They would have to be explicitly checked for and generated as strings. There are a couple of ways to do that, either make yajl_gen do it (in libCom/src/yajl) or have pvDataCPP add the checks. The latter would then work with 3.14.12.x and 3.15 versions of Base.

- Andrew

-- 
Complicity is easy, Simplexity takes real work

> On Feb 7, 2024, at 12:54 PM, Michael Davidsaver via Core-talk <core-talk at aps.anl.gov> wrote:
> 
> On 2/7/24 02:28, NICOLE Remi via Core-talk wrote:
>> Hello everyone,
>> I planned on upgrading EPICS from 7.0.7 to 7.0.8 in our build system,
>> but had some errors in our PV access tests.
>> Apparently, in 7.0.8, the 'pvget my:pv -M json' now returns JSON5:
>>     my:pv:name
>> {value:42.0,alarm:{severity:0,status:0,message:""},display:{description
>> :"My PV description"}}
>> Where before in 7.0.7, it returnd standard JSON:
>>     my:pv:name
>> {"value":42.0,"alarm":{"severity":0,"status":0,"message":""},"display":
>> {"description":"My PV description"}}
>> Was this a conscious choice? I don't see the change in the release
>> notes. I think for interoperability, standard JSON would be better.
> 
> This change was the result of:
> 
> https://github.com/epics-base/pvDataCPP/pull/93
> 
> Further changing to add "-M json5" seems reasonable
> to me.  I will let Andrew say more.
> 

Replies:
Re: pvget -M json is JSON5 Zimoch Dirk via Core-talk
References:
pvget -M json is JSON5 NICOLE Remi via Core-talk
Re: pvget -M json is JSON5 Michael Davidsaver via Core-talk

Navigate by Date:
Prev: Re: pvget -M json is JSON5 Michael Davidsaver via Core-talk
Next: Re: pvget -M json is JSON5 Zimoch Dirk via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
Navigate by Thread:
Prev: Re: pvget -M json is JSON5 Michael Davidsaver via Core-talk
Next: Re: pvget -M json is JSON5 Zimoch Dirk via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
ANJ, 09 Feb 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·