There are many implementations of JSON encoders/decoders. There’s probably one on your system already if you have certain plugins installed. It’s usually just a matter of accessing the module and calling its decode function.
local json = require "json" -- actual text depends on installed json module
local result = json.decode(json_string)
Going the other way is just as easy:
local json_string = json.encode(result)
The [tt]result[/tt] contains the decoded table structure of the given json string.
I’ll add a link to a module, but if you have dataMine installed, then it has one called [tt]json-dm[/tt].