const exportInnerTypesMap = {
'constituent-vnfd': 'nsd.constituent-vnfd',
+ 'config-parameter-map': 'nsd.config-parameter-map',
'vdu': 'vnfd.vdu'
};
function serialize_leaf_list(data) {
data = data[this.name];
if (data) {
- commaSeparatedValues = data.reduce((d, v) => {
- let leaf = Serializer.leaf.call(this, d);
- let value = leaf & leaf[this.name];
- if (value && value.length) {
- if (v.length) {
- v += ', ';
- }
- v += value;
+ data = data.reduce((result, value) => {
+ if (value !== '' && value !== null && value !== undefined && typeof value !== 'object') {
+ result.push(value);
}
- }, "");
- if (commaSeparatedValues.length) {
+ return result;
+ }, []);
+ if (data.length){
let obj = {};
- obj[this.name] = commaSeparatedValues;
+ obj[this.name] = data;
return obj;
}
}
let keys = Object.keys(data);
if (keys) {
const chosen = this.properties.find(
- c => c.type === 'case' && c.properties && c.properties.some(p => keys.indexOf(p.name) > -1));
+ c => c.type === 'case' && c.properties && c.properties.some(p => keys.indexOf(p.name) > -1 && data[p.name]));
return chosen && serializeAll(chosen.properties, data);
}
return null;
parentMap[':meta'] = parentObj;
const properties = parentObj && parentObj.properties ? parentObj.properties : [];
properties.forEach(p => {
+ const colonIndex = p.name.indexOf(':');
+ if (colonIndex > 0) {
+ p.name = p.name.slice(colonIndex+1);
+ }
parentMap[p.name] = mapProperties({}, assign(p, {
':qualified-type': parentObj[':qualified-type'] + '.' + p.name
}));