Support additional operands for node filters
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / tosca / validators / ListValidator.java
index a069e25..46fd44d 100644 (file)
@@ -69,6 +69,30 @@ public class ListValidator implements PropertyTypeValidator {
                 case JSON:
                     innerValidator = ToscaPropertyType.JSON.getValidator();
                     break;
+                case MAP:
+                       innerValidator = ToscaPropertyType.MAP.getValidator();
+                       break;
+                case RANGE:
+                    innerValidator = ToscaPropertyType.RANGE.getValidator();
+                    break;
+                case SCALAR_UNIT_BITRATE:
+                    innerValidator = ToscaPropertyType.SCALAR_UNIT_BITRATE.getValidator();
+                    break;
+                case SCALAR_UNIT_FREQUENCY:
+                    innerValidator = ToscaPropertyType.SCALAR_UNIT_FREQUENCY.getValidator();
+                    break;
+                case SCALAR_UNIT_TIME:
+                    innerValidator = ToscaPropertyType.SCALAR_UNIT_TIME.getValidator();
+                    break;
+                case SCALAR_UNIT_SIZE:
+                    innerValidator = ToscaPropertyType.SCALAR_UNIT_SIZE.getValidator();
+                    break;
+                case SCALAR_UNIT:
+                    innerValidator = ToscaPropertyType.SCALAR_UNIT.getValidator();
+                    break;
+                case TIMESTAMP:
+                    innerValidator = ToscaPropertyType.TIMESTAMP.getValidator();
+                    break;
                 default:
                     log.debug("inner Tosca Type is unknown. {}", innerToscaType);
                     return false;
@@ -88,7 +112,7 @@ public class ListValidator implements PropertyTypeValidator {
             for (int i = 0; i < size; i++) {
                 JsonElement currentValue = jo.get(i);
                 String element = JsonUtils.toString(currentValue);
-                if (!innerValidator.isValid(element, null, allDataTypes)) {
+                if (!innerValidator.isValid(element, innerToscaType.equals(ToscaPropertyType.MAP)? ToscaPropertyType.STRING.getType(): null, allDataTypes)) {
                     log.debug("validation of element : {} failed", element);
                     return false;
                 }