Fix the parser so that we support the new tosca policy discussed
Issue-ID: CLAMP-186
Change-Id: I3051dddf749f1969f8b1d12d726c65f6aad48d51
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
LinkedHashMap<String, Object> dataNodes) {
map.entrySet().stream().forEach(n -> {
if (n.getKey().contains(ToscaSchemaConstants.NODE_TYPES) && n.getValue() instanceof Map) {
LinkedHashMap<String, Object> dataNodes) {
map.entrySet().stream().forEach(n -> {
if (n.getKey().contains(ToscaSchemaConstants.NODE_TYPES) && n.getValue() instanceof Map) {
parseNodeAndDataType((LinkedHashMap<String, Object>) n.getValue(), nodeTypes, dataNodes);
parseNodeAndDataType((LinkedHashMap<String, Object>) n.getValue(), nodeTypes, dataNodes);
} else if (n.getKey().contains(ToscaSchemaConstants.DATA_TYPES) && n.getValue() instanceof Map) {
} else if (n.getKey().contains(ToscaSchemaConstants.DATA_TYPES) && n.getValue() instanceof Map) {
parseNodeAndDataType((LinkedHashMap<String, Object>) n.getValue(), nodeTypes, dataNodes);
parseNodeAndDataType((LinkedHashMap<String, Object>) n.getValue(), nodeTypes, dataNodes);
} else if (n.getKey().contains(ToscaSchemaConstants.POLICY_NODE)) {
} else if (n.getKey().contains(ToscaSchemaConstants.POLICY_NODE)) {
nodeTypes.put(n.getKey(), n.getValue());
nodeTypes.put(n.getKey(), n.getValue());
} else if (n.getKey().contains(ToscaSchemaConstants.POLICY_DATA)) {
} else if (n.getKey().contains(ToscaSchemaConstants.POLICY_DATA)) {
dataNodes.put(n.getKey(), n.getValue());
}
dataNodes.put(n.getKey(), n.getValue());
}
.getValue();
if (parentPropertiesMap.containsKey(ToscaSchemaConstants.TYPE)
&& ((String) parentPropertiesMap.get(ToscaSchemaConstants.TYPE))
.getValue();
if (parentPropertiesMap.containsKey(ToscaSchemaConstants.TYPE)
&& ((String) parentPropertiesMap.get(ToscaSchemaConstants.TYPE))
- .contains(ToscaSchemaConstants.TYPE_LIST)
+ .contains(ToscaSchemaConstants.TYPE_MAP)
&& parentPropertiesMap.containsKey(ToscaSchemaConstants.ENTRY_SCHEMA)) {
parentPropertiesMap = (LinkedHashMap<String, Object>) parentPropertiesMap
.get(ToscaSchemaConstants.ENTRY_SCHEMA);
&& parentPropertiesMap.containsKey(ToscaSchemaConstants.ENTRY_SCHEMA)) {
parentPropertiesMap = (LinkedHashMap<String, Object>) parentPropertiesMap
.get(ToscaSchemaConstants.ENTRY_SCHEMA);
version: 1.0.0
properties:
tca_policy:
version: 1.0.0
properties:
tca_policy:
description: TCA Policy JSON
entry_schema:
type: onap.datatypes.monitoring.tca_policy
description: TCA Policy JSON
entry_schema:
type: onap.datatypes.monitoring.tca_policy