Use pkg_sbuf_printf for the JSON preparation