Skip to content

Commit

Permalink
#16 resolve duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
faizanvahevaria committed Jun 21, 2019
1 parent 39f4f87 commit fb89f1f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions openApi-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class OpenApiGenerator {
let arrAttr = [];

let i,len;
for (i = 0, len = objClass.attributes.length && !flagNoName ; i < len; i++) {
for (i = 0, len = objClass.attributes.length; i < len; i++) {
let attr = objClass.attributes[i];
let filterAttr = arrAttr.filter(item=>{
return item.name==attr.name;
Expand Down Expand Up @@ -299,7 +299,7 @@ class OpenApiGenerator {
if (assocClassLink.length > 0) {
assocClassLink.forEach(item => {
this.writeAssociationClassProperties(codeWriter, item);

arrAssoc.push(item.classSide);
})
}

Expand All @@ -322,13 +322,10 @@ class OpenApiGenerator {
let filterAssoc = arrAssoc.filter(item=>{
return item.name==assoc.name;
});




if(filterAssoc.length==0 && assoc.name!="" && !flagNoName){



if(assoc.end1.aggregation=="shared"){
// this.writeAssociationProperties(codeWriter,assoc);
aggregationClasses.push(assoc.end2.reference);
Expand Down Expand Up @@ -375,9 +372,11 @@ class OpenApiGenerator {
}
arrAssoc.push(assoc);
}else {
flagNoName = true;
let str = assoc.end1.reference.name + "-" + assoc.end2.reference.name;
noNameRel.push(str);
if(assoc.name==""){
flagNoName = true;
let str = assoc.end1.reference.name + "-" + assoc.end2.reference.name;
noNameRel.push(str);
}
}
}else if(assoc instanceof type.UMLGeneralization){
arrGeneral.push(assoc);
Expand Down

0 comments on commit fb89f1f

Please sign in to comment.