diff options
Diffstat (limited to 'grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java')
-rw-r--r-- | grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java b/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java index 8b9448b7..93b5beee 100644 --- a/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java +++ b/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java @@ -45,8 +45,7 @@ import org.open.infc.grpc.Result; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import com.google.gson.JsonParser; import io.grpc.Server; import io.grpc.ServerBuilder; @@ -55,7 +54,6 @@ import io.grpc.stub.StreamObserver; public class OpenInterfaceGrpcServer { private static final Logger logger = LoggerFactory.getLogger(OpenInterfaceGrpcServer.class.getName()); - private static Gson gson = new GsonBuilder().serializeNulls().create(); private static final String CONF_FILE = "oclip-grpc-server.properties"; private static final String CONF_SERVER_PORT = "oclip.grpc_server_port"; @@ -248,7 +246,7 @@ public class OpenInterfaceGrpcServer { reply.setSuccess(cmd.getResult().isPassed()); try { - reply.putAttrs(OnapCommandConstants.RESULTS, gson.fromJson(printOut,String.class)); + reply.putAttrs(OnapCommandConstants.RESULTS, new JsonParser().parse(printOut).toString()); } catch (Exception e) { // NOSONAR reply.putAttrs(OnapCommandConstants.RESULTS, printOut); } |