Showing
1 changed file
with
9 additions
and
3 deletions
@@ -155,12 +155,18 @@ public class JsonConverter { | @@ -155,12 +155,18 @@ public class JsonConverter { | ||
155 | } | 155 | } |
156 | 156 | ||
157 | public static JsonElement toJson(TransportProtos.ToDeviceRpcRequestMsg msg, boolean includeRequestId) { | 157 | public static JsonElement toJson(TransportProtos.ToDeviceRpcRequestMsg msg, boolean includeRequestId) { |
158 | - JsonObject result = new JsonObject(); | 158 | + JsonObject result = null; |
159 | + if("methodThingskit".equals(msg.getMethodName())){ | ||
160 | + result= JSON_PARSER.parse(msg.getParams()).getAsJsonObject(); | ||
161 | + }else{ | ||
162 | + result = new JsonObject(); | ||
163 | + result.addProperty("method", msg.getMethodName()); | ||
164 | + result.add("params", JSON_PARSER.parse(msg.getParams())); | ||
165 | + } | ||
159 | if (includeRequestId) { | 166 | if (includeRequestId) { |
160 | result.addProperty("id", msg.getRequestId()); | 167 | result.addProperty("id", msg.getRequestId()); |
161 | } | 168 | } |
162 | - result.addProperty("method", msg.getMethodName()); | ||
163 | - result.add("params", JSON_PARSER.parse(msg.getParams())); | 169 | + |
164 | return result; | 170 | return result; |
165 | } | 171 | } |
166 | 172 |