summaryrefslogtreecommitdiffstats
path: root/aai-schema-gen/src/main
diff options
context:
space:
mode:
authorKeong Lim <keong.lim@huawei.com>2019-07-19 18:43:10 +1000
committerKeong Lim <keong.lim@huawei.com>2019-08-08 14:52:43 +1000
commitc44bcf608dc25c2047af65fbfdecba7dbce11e88 (patch)
tree6120423b356919b93b979e04a2c3ff6adbf4f5a3 /aai-schema-gen/src/main
parent8d4ca0d78d2b34a07473d8a9293173c798d0a1f8 (diff)
AAI-2441 update swagger-format YAML generation
update swagger-format YAML generation so that conversion to JSON is cleaner, i.e. use n/a instead of null string in empty fields update tests to match new output with n/a values update generate-uml-snapshot.sh to also convert yaml to json add the generated json files Change-Id: Idd87ddae3c2d7490eb954ef69582edd8200f4df4 Issue-ID: AAI-2441 Signed-off-by: Keong Lim <keong.lim@huawei.com>
Diffstat (limited to 'aai-schema-gen/src/main')
-rw-r--r--aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java4
-rw-r--r--aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/XSDElement.java2
-rw-r--r--aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java4
3 files changed, 5 insertions, 5 deletions
diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java
index a491872..9ff0fa3 100644
--- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java
+++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java
@@ -92,8 +92,8 @@ public class NodesYAMLfromOXM extends OxmFileProcessor {
sb.append(" title: Active and Available Inventory REST API" + LINE_SEPARATOR);
sb.append(
" license:" + LINE_SEPARATOR + " name: Apache 2.0" + LINE_SEPARATOR + " url: http://www.apache.org/licenses/LICENSE-2.0.html" + LINE_SEPARATOR);
- sb.append(" contact:" + LINE_SEPARATOR + " name:" + LINE_SEPARATOR + " url:" + LINE_SEPARATOR + " email:" + LINE_SEPARATOR);
- sb.append("host:" + LINE_SEPARATOR + "basePath: " + basePath + "/" + v.toString() + LINE_SEPARATOR);
+ sb.append(" contact:" + LINE_SEPARATOR + " name: n/a" + LINE_SEPARATOR + " url: n/a" + LINE_SEPARATOR + " email: n/a" + LINE_SEPARATOR);
+ sb.append("host: n/a" + LINE_SEPARATOR + "basePath: " + basePath + "/" + v.toString() + LINE_SEPARATOR);
sb.append("schemes:" + LINE_SEPARATOR + " - https\npaths:" + LINE_SEPARATOR);
return sb.toString();
}
diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/XSDElement.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/XSDElement.java
index 0e5c2fa..38117e5 100644
--- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/XSDElement.java
+++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/XSDElement.java
@@ -237,7 +237,7 @@ public class XSDElement implements Element {
if ( this.getAttribute("description") != null && this.getAttribute("description").length() > 0 )
sbParameter.append((" description: " + this.getAttribute("description") + "\n"));
else
- sbParameter.append((" description:\n"));
+ sbParameter.append((" description: n/a\n"));
sbParameter.append((" required: false\n"));
if ( ("java.lang.String").equals(this.getAttribute("type")))
sbParameter.append(" type: string\n");
diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java
index 32ae998..b75a1dc 100644
--- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java
+++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java
@@ -93,8 +93,8 @@ public class YAMLfromOXM extends OxmFileProcessor {
sb.append(" title: Active and Available Inventory REST API" + LINE_SEPARATOR);
sb.append(
" license:" + LINE_SEPARATOR + " name: Apache 2.0\n url: http://www.apache.org/licenses/LICENSE-2.0.html" + LINE_SEPARATOR);
- sb.append(" contact:" + LINE_SEPARATOR + " name:" + LINE_SEPARATOR + " url:" + LINE_SEPARATOR + " email:" + LINE_SEPARATOR);
- sb.append("host:" + LINE_SEPARATOR + "basePath: " + basePath + "/" + v.toString() + LINE_SEPARATOR);
+ sb.append(" contact:" + LINE_SEPARATOR + " name: n/a" + LINE_SEPARATOR + " url: n/a" + LINE_SEPARATOR + " email: n/a" + LINE_SEPARATOR);
+ sb.append("host: n/a" + LINE_SEPARATOR + "basePath: " + basePath + "/" + v.toString() + LINE_SEPARATOR);
sb.append("schemes:" + LINE_SEPARATOR + " - https\npaths:" + LINE_SEPARATOR);
return sb.toString();
}