diff --git a/app-stream-network/app-stream-network-ws/src/main/java/com/dingtalk/open/app/stream/network/ws/WebSocketContext.java b/app-stream-network/app-stream-network-ws/src/main/java/com/dingtalk/open/app/stream/network/ws/WebSocketContext.java index b8a3172..d57b9e3 100644 --- a/app-stream-network/app-stream-network-ws/src/main/java/com/dingtalk/open/app/stream/network/ws/WebSocketContext.java +++ b/app-stream-network/app-stream-network-ws/src/main/java/com/dingtalk/open/app/stream/network/ws/WebSocketContext.java @@ -1,6 +1,7 @@ package com.dingtalk.open.app.stream.network.ws; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; import com.dingtalk.open.app.stream.network.api.Context; import com.dingtalk.open.app.stream.network.api.ServiceException; import com.dingtalk.open.app.stream.network.api.logger.InternalLogger; @@ -28,7 +29,7 @@ public WebSocketContext(String connectionId, ProtocolRequestFacade request, Chan @Override public void replay(Object payload) { ProtocolResponse response = ProtocolResponse.new200Response(request); - response.setData(JSON.toJSONString(payload)); + response.setData(JSON.toJSONString(payload, SerializerFeature.WriteMapNullValue)); context.writeAndFlush(response).addListener(future -> { if (!future.isSuccess()) { LOGGER.error("[DingTalk] websocket connection reply response failed, connectionId={}, messageId={}", connectionId, request.getMessageId(), future.cause());