(Last Updated: May 1, 2020)

cjson



  • @akbooer

    Do you suggest we switch our plugins and scenes to cjson instead of dkjson for json decoding?



  • Cjson is very strict about syntax. If you don’t care about Vera compatibility in what you’re writing, then I’d always use the openLuup.json module for both encode (which pretty-prints and sorts keys alphabetically) and decode (which will use Cjson if installed on the system, and deals with the errors that it generates.)

    If you need to run on Vera then either use dkjson, or the approach which @reneboer has just posted in the other place.

    Frankly, I wouldn’t bother unless it’s a high volume usage, the classic examples being in VeraBridge and the ZWay plugin.


Log in to reply