Open nakulshah opened 7 years ago
Why not just send an empty string if word2 is null?
we have two interfaces. (1) REST and (2) websocket
For REST, which is already in production, we use { "word1": "hello", "word2": null}
convention. So we would like to be consistent with this in our websocket offering
hello, My software is using group: 'com.corundumstudio.socketio', name: 'netty-socketio', version: '1.7.7' It has a class
MyClass(String word1, String word2)
It calls.sendEvent("response", myClassObject);
When both word1 and word2 are populated, a full json{ "word1": "hello", "word2": "world" }
is sent across. But if a property is null, then that property is not sent across, for example if word1=hello and word2 is not initialized. Then the json is{ "word1": "hello"}
Question: Is there a way to have net-socketio send
{ "word1": "hello", "word2": null}
?