Use gson by default 73/78673/1
authorjh7358 <jh7358@att.com>
Mon, 18 Feb 2019 14:37:38 +0000 (09:37 -0500)
committerJim Hahn <jrh3@att.com>
Mon, 18 Feb 2019 14:52:51 +0000 (09:52 -0500)
Add a property to force the REST server to use gson instead of jackson.

Change-Id: I0dd762e0f9b4a4809f68e5b5498e16136f611d12
Issue-ID: POLICY-1525
Signed-off-by: Jim Hahn <jrh3@att.com>
main/src/main/java/org/onap/policy/distribution/main/rest/DistributionRestServer.java

index 8f7652b..8e78fdb 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019 AT&T Intellectual Property.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +28,7 @@ import java.util.Properties;
 
 import org.onap.policy.common.capabilities.Startable;
 import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.gson.JacksonHandler;
 import org.onap.policy.distribution.main.parameters.RestServerParameters;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -94,6 +96,8 @@ public class DistributionRestServer implements Startable {
                 restServerParameters.getPassword());
         props.setProperty(HTTP_SERVER_SERVICES + SEPARATOR + restServerParameters.getName() + ".https",
                 String.valueOf(restServerParameters.isHttps()));
+        props.setProperty(HTTP_SERVER_SERVICES + SEPARATOR + restServerParameters.getName() + ".serialization.provider",
+                JacksonHandler.class.getName());
         return props;
     }