summaryrefslogtreecommitdiffstats
path: root/plugins/restapi-call-node/provider/src/main
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2022-07-13 17:05:40 -0400
committerSingal, Kapil (ks220y) <ks220y@att.com>2022-07-14 10:11:39 -0400
commit400408a5bf555ddca5521e1f7c44d256ab941c01 (patch)
treed5c276571ba5fa71e91887d1261ddb3ccafa84c6 /plugins/restapi-call-node/provider/src/main
parent4c92a51c0f81f1bcb5d85a2d7ec2b827904df036 (diff)
Restapi-call-node: Support for Empty Container {} in JSON
Issue-ID: CCSDK-3718 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com> Change-Id: If3c030f3de78d21f1ab0bcdebc234b7697871314
Diffstat (limited to 'plugins/restapi-call-node/provider/src/main')
-rwxr-xr-xplugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java10
-rw-r--r--plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java1
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
index 4236055dc..2064dc864 100755
--- a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
+++ b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
@@ -641,6 +641,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
if (format == Format.JSON) {
req = XmlJsonUtil.removeLastCommaJson(req);
+ // Use 'EMPTY_CONTAINER' as keyword within template to have an empty container placeholder.
+ req = req.replaceAll("EMPTY_CONTAINER", "{}");
}
long t2 = System.currentTimeMillis();
@@ -803,7 +805,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
URL proxyUrl = new URL(p.proxyUrl);
HttpUrlConnectorProvider cp = new HttpUrlConnectorProvider();
config.connectorProvider(cp);
- final Proxy proxy =
+ final Proxy proxy =
new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort()));
cp.connectionFactory(new ConnectionFactory() {
@@ -822,12 +824,12 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
ssl = createSSLContext(p);
}
- ClientBuilder builder =
+ ClientBuilder builder =
ClientBuilder.newBuilder().hostnameVerifier(new AcceptIpAddressHostNameVerifier());
- if (ssl != null) {
+ if (ssl != null) {
HttpsURLConnection.setDefaultSSLSocketFactory(ssl.getSocketFactory());
- builder = builder.sslContext(ssl);
+ builder = builder.sslContext(ssl);
}
if (config != null) {
builder = builder.withConfig(config);
diff --git a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java
index d6ef7463a..a4407c005 100644
--- a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java
+++ b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java
@@ -443,7 +443,6 @@ public final class XmlJsonUtil {
i5 = s.length();
}
-
/*If template mandates empty construct to be present, those should not be removed.*/
if (template != null && template.contains(s.substring(i4))) {
k = i1 + 1;