JacksonUtils.kt primitives bugfix 91/93891/1
authorOleg Mitsura <oleg.mitsura@amdocs.com>
Mon, 19 Aug 2019 19:54:21 +0000 (15:54 -0400)
committerOleg Mitsura <oleg.mitsura@amdocs.com>
Mon, 19 Aug 2019 19:54:21 +0000 (15:54 -0400)
Issue-Id: CCSDK-1614

Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com>
Change-Id: I1991c1605889ea152fca2d93f5d31b073dd7985d

ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt

index 7c2466f..9e71bfe 100644 (file)
@@ -243,8 +243,8 @@ class JacksonUtils {
                 BluePrintConstants.DATA_TYPE_FLOAT,
                 BluePrintConstants.DATA_TYPE_DOUBLE,
                 BluePrintConstants.DATA_TYPE_TIMESTAMP,
-                BluePrintConstants.DATA_TYPE_STRING->
-                    objectNode.set(key, value.asJsonPrimitive())
+                BluePrintConstants.DATA_TYPE_STRING ->
+                    objectNode.set(key, value as JsonNode)
                 else -> throw BluePrintException("populatePrimitiveValues expected only primitive values! Received: ($value)")
             }
         }
@@ -256,7 +256,7 @@ class JacksonUtils {
                 BluePrintConstants.DATA_TYPE_FLOAT,
                 BluePrintConstants.DATA_TYPE_DOUBLE,
                 BluePrintConstants.DATA_TYPE_TIMESTAMP,
-                BluePrintConstants.DATA_TYPE_STRING -> arrayNode.add(value.asJsonPrimitive())
+                BluePrintConstants.DATA_TYPE_STRING -> arrayNode.add(value as JsonNode)
                 else -> throw BluePrintException("populatePrimitiveValues expected only primitive values! Received: ($value)")
             }
         }
@@ -300,7 +300,6 @@ class JacksonUtils {
                 BluePrintConstants.DATA_TYPE_INTEGER -> jsonNodeFromObject(value.toInt())
                 BluePrintConstants.DATA_TYPE_FLOAT -> jsonNodeFromObject(value.toFloat())
                 BluePrintConstants.DATA_TYPE_DOUBLE -> jsonNodeFromObject(value.toDouble())
-                //TODO: Verify.. I assume string type should be here..
                 BluePrintConstants.DATA_TYPE_STRING -> jsonNodeFromObject(value)
                 else -> getJsonNode(value)
             }