summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
authorOleg Mitsura <oleg.mitsura@amdocs.com>2019-08-22 15:05:01 -0400
committerOleg Mitsura <oleg.mitsura@amdocs.com>2019-08-27 12:50:53 -0400
commit359e2a243b5586c2d844b5053279c4569343c5fe (patch)
treeeb182c6b47f87cb7a260a3c49e134fde6cc46c60 /ms/controllerblueprints
parentb496e93839fba89a8ea2ab026954a6f6359bc4c2 (diff)
allow null type for primitives
(to be consistent with validPrimitiveTypes() in BluePrintTypes) TODO: refactor that as well. This should fix the issue with missing values in output-type-mapping breaking execution. Issue-Id: CCSDK-1614 Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ia209a3bfcdc5fc2ef1179bd46669be2d57426749
Diffstat (limited to 'ms/controllerblueprints')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt
index 73dff9379..1f1345327 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt
@@ -243,7 +243,8 @@ class JacksonUtils {
BluePrintConstants.DATA_TYPE_FLOAT,
BluePrintConstants.DATA_TYPE_DOUBLE,
BluePrintConstants.DATA_TYPE_TIMESTAMP,
- BluePrintConstants.DATA_TYPE_STRING ->
+ BluePrintConstants.DATA_TYPE_STRING,
+ BluePrintConstants.DATA_TYPE_NULL ->
objectNode.set(key, value)
else -> throw BluePrintException("populatePrimitiveValues expected only primitive values! Received: ($value)")
}
@@ -256,7 +257,9 @@ class JacksonUtils {
BluePrintConstants.DATA_TYPE_FLOAT,
BluePrintConstants.DATA_TYPE_DOUBLE,
BluePrintConstants.DATA_TYPE_TIMESTAMP,
- BluePrintConstants.DATA_TYPE_STRING -> arrayNode.add(value)
+ BluePrintConstants.DATA_TYPE_STRING,
+ BluePrintConstants.DATA_TYPE_NULL ->
+ arrayNode.add(value)
else -> throw BluePrintException("populatePrimitiveValues expected only primitive values! Received: ($value)")
}
}
@@ -284,7 +287,7 @@ class JacksonUtils {
}
}
- fun populateJsonNodeValues(key: String, nodeValue: JsonNode, type: String, objectNode: ObjectNode) {
+ fun populateJsonNodeValues(key: String, nodeValue: JsonNode?, type: String, objectNode: ObjectNode) {
if (nodeValue == null || nodeValue is NullNode) {
objectNode.set(key, nodeValue)
} else if (BluePrintTypes.validPrimitiveTypes().contains(type)) {