aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java2
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java15
2 files changed, 10 insertions, 7 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
index 96366194d3..f43f7de860 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
@@ -2077,7 +2077,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
if (jsonObject.has(path.get(0))) {
objectForPath = jsonObject.get(path.get(0));
} else {
- if (StringUtils.isNumeric(path.get(0))) {
+ if (path.size() > 1 && StringUtils.isNumeric(path.get(1))) {
objectForPath = new JSONArray();
} else {
objectForPath = new JSONObject();
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java
index 247fff9bc6..ef7363a1a3 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java
@@ -61,6 +61,9 @@ public class PropertyValueConstraintValidationUtil {
private static final String IGNORE_PROPERTY_VALUE_START_WITH_INPUT = "{\"get_input\":";
private static final String IGNORE_PROPERTY_VALUE_START_WITH_PROPERTY = "{\"get_property\":";
private static final String IGNORE_PROPERTY_VALUE_START_WITH_ATTRIBUTE = "{\"get_attribute\":";
+ private static final String IGNORE_PROPERTY_VALUE_INPUT = "{get_input=";
+ private static final String IGNORE_PROPERTY_VALUE_PROPERTY = "{get_property=";
+ private static final String IGNORE_PROPERTY_VALUE_ATTRIBUTE = "{get_attribute=";
private Map<String, DataTypeDefinition> dataTypeDefinitionCache;
private final ObjectMapper objectMapper = new ObjectMapper();
private final List<String> errorMessages = new ArrayList<>();
@@ -159,8 +162,10 @@ public class PropertyValueConstraintValidationUtil {
}
private boolean isValueAToscaFunction(PropertyDefinition propertyDefinition) {
- return propertyDefinition.getToscaFunction() != null || propertyDefinition.getValue() != null && (propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_START_WITH_INPUT) || propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_START_WITH_PROPERTY)
- || propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_START_WITH_ATTRIBUTE));
+ return (propertyDefinition.getToscaFunction() != null) || (propertyDefinition.getValue() != null
+ && ((propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_START_WITH_INPUT) || propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_START_WITH_PROPERTY)
+ || propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_START_WITH_ATTRIBUTE) || propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_ATTRIBUTE)
+ || propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_PROPERTY) || propertyDefinition.getValue().startsWith(IGNORE_PROPERTY_VALUE_INPUT))));
}
private void checkAndEvaluatePrimitiveProperty(PropertyDefinition propertyDefinition, DataTypeDefinition dataTypeDefinition) {
@@ -197,10 +202,8 @@ public class PropertyValueConstraintValidationUtil {
if (propertyDefinition.getSubPropertyToscaFunctions() != null) {
for (SubPropertyToscaFunction subPropertyToscaFunction : propertyDefinition.getSubPropertyToscaFunctions()) {
final List<String> path = subPropertyToscaFunction.getSubPropertyPath();
- if (path.size() == 1) {
- if (path.get(0).equals(prop.getName())) {
- return;
- }
+ if (path.size() == 1 && path.get(0).equals(prop.getName())) {
+ return;
}
if (path.size() > 1) {
if (path.get(0).equals(propertyDefinition.getToscaSubPath()) && path.get(1).equals(prop.getName())) {