mojarra icon indicating copy to clipboard operation
mojarra copied to clipboard

WebSocketSessionManager.send(String,Object) should use JSON-B (JSR-367)

Open ronelm2000 opened this issue 7 years ago • 0 comments

Please replace:

            String json = Json.encode(message);

with:

            Jsonb jsonb = JsonbBuilder.create(); // this could also just be a bean?
            String json = jsonb.toJson(message);

com.sun.faces.util.Json.encode only contains the bare minimum for my functional requirements. Json.encode doesn't utilize custom annotations to stop bidirectional loops nor defining custom json (it already loops on a typical Enum class). In my case particularly, I'd like to either implement Yasson or make my own GSON/Jackson wrapper.

ronelm2000 avatar Aug 24 '18 01:08 ronelm2000