Fix JsonContext::encode method to use  and not ->getJson()