epics-base / pvDataCPP

pvDataCPP is an EPICS V4 C++ module
https://epics-base.github.io/pvDataCPP/
Other
6 stars 16 forks source link

LP: #2029482 — pvget json error #92

Closed anjohnson closed 1 year ago

anjohnson commented 1 year ago

In LP: #2029482 Matt Clark reports that pvget -M json doesn't print fields containing NaN values and generates an error "Error in monitor handler : yajl_gen_invalid_number" instead.

The simplest fix would be for the json formatter to just output json5 (available when pvDataCPP is built against 7.0.6.1 or later), in which case the patch I posted to the LP bug above implements that.

A possible alternative would be to add a separate -M json5 formatter option which enables the json5 option; properly supporting NaNs and Infinity in regular json would require converting them as strings.

mdavidsaver commented 1 year ago

... the patch I posted to the LP bug ...

It isn't much use there. Maybe a PR?

anjohnson commented 1 year ago

It may be useful to the bug's reporter, I didn't have time to do the PR yesterday.