// If the datatype has 'properties' definition
else {
if(!(value instanceof LinkedHashMap)) {
- ExceptionCollector.appendException(String.format(
- "TypeMismatchError: \"%s\" doesn't match \"%s\"",
+ //ERROR under investigation
+ ExceptionCollector.appendWarning(String.format(
+ "TypeMismatchError: \"%s\" is not a map. The type is \"%s\"",
value.toString(),dataType.getType()));
if (value instanceof List)
// check allowed field
for(String valueKey: valueDict.keySet()) {
- if(!allowedProps.contains(valueKey)) {
+ //1710 devlop JSON validation
+ if(!("json").equals(dataType.getType()) && !allowedProps.contains(valueKey)) {
ExceptionCollector.appendException(String.format(
"UnknownFieldError: Data value of type \"%s\" contains unknown field \"%s\"",
dataType.getType(),valueKey));
}
}
if(missingProp.size() > 0) {
- ExceptionCollector.appendException(String.format(
+ ExceptionCollector.appendWarning(String.format(
"MissingRequiredFieldError: Data value of type \"%s\" is missing required field(s) \"%s\"",
dataType.getType(),missingProp.toString()));
}
if(Function.isFunction(value)) {
return value;
}
+ else if (type == null) {
+ //NOT ANALYZED
+ ExceptionCollector.appendWarning(String.format(
+ "MissingType: Type is missing for value \"%s\"",
+ value.toString()));
+ return value;
+ }
else if(type.equals(Schema.STRING)) {
return ValidateUtils.validateString(value);
}
}
// Required properties found without value or a default value
if(!reqPropsNoValueOrDefault.isEmpty()) {
- ExceptionCollector.appendException(String.format(
+ ExceptionCollector.appendWarning(String.format(
"MissingRequiredFieldError: properties of template \"%s\" are missing field(s): %s",
name,reqPropsNoValueOrDefault.toString()));
}
for(NodeTemplate nt: nodeTemplates) {
if(_isSubMappedNode(nt,toscaTpl)) {
parsedParams = _getParamsForNestedTemplate(nt);
+ ArrayList<Object> alim = (ArrayList<Object>)toscaTpl.get(IMPORTS);
LinkedHashMap<String,Object> topologyTpl =
(LinkedHashMap<String,Object>)toscaTpl.get(TOPOLOGY_TEMPLATE);
TopologyTemplate topologyWithSubMapping =
new TopologyTemplate(topologyTpl,
- _getAllCustomDefs(null),
+ //_getAllCustomDefs(null),
+ _getAllCustomDefs(alim),
relationshipTypes,
parsedParams,
nt);
// attr,
// value,
// valid_values)
- ExceptionCollector.appendException(String.format(
+ ExceptionCollector.appendWarning(String.format(
"Schema definition of \"%s\" has \"status\" attribute with an invalid value",
name));
}
return key;
}
}
- ExceptionCollector.appendException(String.format(
+ ExceptionCollector.appendWarning(String.format(
"'The unit \"%s\" is not valid. Valid units are \n%s",
inputUnit,SCALAR_UNIT_DICT.keySet().toString()));
return inputUnit;
value = ScalarUnit.getScalarunitValue(propertyType,value,null);
}
if(!_isValid(value)) {
- ExceptionCollector.appendException("ValidationError: " + _errMsg(value));
+ ExceptionCollector.appendWarning("ValidationError: " + _errMsg(value));
}
}
public static final String VERSION = "version";
public static final String PORTDEF = "PortDef";
public static final String PORTSPEC = "PortSpec"; //??? PortSpec.SHORTNAME
- public static final String JSON = "json";
+ public static final String JSON = "json";
public static final String PROPERTY_TYPES[] = {
INTEGER, STRING, BOOLEAN, FLOAT, RANGE,NUMBER, TIMESTAMP, LIST, MAP,
@Override
void validate() {
if(args.size() != 1) {
- ExceptionCollector.appendException(String.format(
+ //ERROR under investigation
+ ExceptionCollector.appendWarning(String.format(
"ValueError: Expected one argument for function \"get_input\" but received \"%s\"",
args.toString()));
}
capabilities:
link:
type: tosca.capabilities.network.Linkable
-
+
tosca.nodes.network.Port:
derived_from: tosca.nodes.Root
description: >
tosca.datatypes.Root:
description: >
The TOSCA root Data Type all other TOSCA base Data Types derive from
-
+
tosca.datatypes.network.NetworkInfo:
derived_from: tosca.datatypes.Root
properties:
if (!exceptionReport.isEmpty()) {\r
\r
try {\r
- fw = new FileWriter(new File(dir + "/critical-" + file.getName() + ".txt"));\r
+ fw = new FileWriter(new File(dir + "/" + exceptionReport.size() / 2 + "-critical-" + file.getName() + ".txt"));\r
for (String exception : exceptionReport) {\r
fw.write(exception);\r
fw.write("\r\n");\r
}\r
fw.close();\r
\r
- fw = new FileWriter(new File(dir + "/warning-" + file.getName() + ".txt"));\r
+ fw = new FileWriter(new File(dir + "/" + warningsReport.size() / 2 + "-warning-" + file.getName() + ".txt"));\r
for (String warning : warningsReport) {\r
fw.write(warning);\r
fw.write("\r\n");\r