From 4a5b6fb5ae433edb6b436bf8f32977ce25c2706c Mon Sep 17 00:00:00 2001 From: faizanvahevaria Date: Fri, 3 Apr 2020 16:26:58 +0530 Subject: [PATCH] #107 : adding the class description --- package-lock.json | 2 +- package.json | 2 +- src/component.js | 2 +- src/composition.js | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d50e706..a72c548 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gs-gs.staruml-cefact", - "version": "0.3.11", + "version": "0.3.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fe77231..8493a6b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "gs-gs.staruml-cefact", "title": "OpenAPI3.0 Generator", "description": "StarUML Extension for generating OpenAPI 3.0 Specs from the UML Diagrams. \nImplementation Rules are according to https://edi3.org/uml-profile/ \nExtension Source Code: https://github.com/gs-gs/staruml-cefact \nExtension version: 0.3.7", - "version": "0.3.11", + "version": "0.3.12", "engines": { "staruml": ">=3.0.0" }, diff --git a/src/component.js b/src/component.js index d9bc1ab..3289f0d 100644 --- a/src/component.js +++ b/src/component.js @@ -131,7 +131,7 @@ class Component { } this.mainSchemaObj[objClass.name] = mainClassesObj - + mainClassesObj.description = objClass.documentation; mainClassesObj.type = 'object'; /** diff --git a/src/composition.js b/src/composition.js index ff70358..86aacba 100644 --- a/src/composition.js +++ b/src/composition.js @@ -48,6 +48,20 @@ class Composition { sName=assoc.end2.reference.name; ref=constant.getReference() + sName; propertiesObj['$ref'] = ref; + propertiesObj.description = assoc.end2.reference.documentation; + + /* let allOfArray = []; + propertiesObj.allOf = allOfArray; + + let objAllOfArry = {}; + sName=assoc.end2.reference.name; + ref=constant.getReference() + sName; + objAllOfArry['$ref'] = ref; + allOfArray.push(objAllOfArry); + + objAllOfArry = {}; + objAllOfArry.description = assoc.end2.reference.documentation; + allOfArray.push(objAllOfArry); */ } let temp={}; temp['ref']=propertiesObj;