diff options
author | Keong Lim <keong.lim@huawei.com> | 2019-07-19 18:43:10 +1000 |
---|---|---|
committer | Keong Lim <keong.lim@huawei.com> | 2019-08-08 14:52:43 +1000 |
commit | c44bcf608dc25c2047af65fbfdecba7dbce11e88 (patch) | |
tree | 6120423b356919b93b979e04a2c3ff6adbf4f5a3 /aai-schema-gen/src/test | |
parent | 8d4ca0d78d2b34a07473d8a9293173c798d0a1f8 (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/test')
3 files changed, 19 insertions, 19 deletions
diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java index 70262ba..d08c3e0 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java @@ -266,10 +266,10 @@ public class NodesYAMLfromOXMTest { sb.append(" name: Apache 2.0" + OxmFileProcessor.LINE_SEPARATOR); sb.append(" url: http://www.apache.org/licenses/LICENSE-2.0.html" + OxmFileProcessor.LINE_SEPARATOR); sb.append(" contact:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append(" name:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append(" url:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append(" email:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append("host:" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" name: n/a" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" url: n/a" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" email: n/a" + OxmFileProcessor.LINE_SEPARATOR); + sb.append("host: n/a" + OxmFileProcessor.LINE_SEPARATOR); sb.append("basePath: /aai/v11" + OxmFileProcessor.LINE_SEPARATOR); sb.append("schemes:" + OxmFileProcessor.LINE_SEPARATOR); sb.append(" - https\n"); @@ -321,17 +321,17 @@ public class NodesYAMLfromOXMTest { sb.append(" null\n parameters:\n"); sb.append(" - name: global-customer-id\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); sb.append(" - name: subscriber-name\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); sb.append(" - name: subscriber-type\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); sb.append(" /nodes/service-subscriptions/service-subscription/{service-type}:\n"); @@ -376,7 +376,7 @@ public class NodesYAMLfromOXMTest { sb.append(" null\n parameters:\n"); sb.append(" - name: service-type\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); return sb.toString(); diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/XSDElementTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/XSDElementTest.java index 6b21dfd..3c072f3 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/XSDElementTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/XSDElementTest.java @@ -523,9 +523,9 @@ public class XSDElementTest { @Test public void testGetQueryParamYAML() { ArrayList<String> target = new ArrayList<String>(); - target.add(" - name: global-customer-id\n in: query\n description:\n required: false\n type: string\n"); - target.add(" - name: subscriber-name\n in: query\n description:\n required: false\n type: string\n"); - target.add(" - name: subscriber-type\n in: query\n description:\n required: false\n type: string\n"); + target.add(" - name: global-customer-id\n in: query\n description: n/a\n required: false\n type: string\n"); + target.add(" - name: subscriber-name\n in: query\n description: n/a\n required: false\n type: string\n"); + target.add(" - name: subscriber-type\n in: query\n description: n/a\n required: false\n type: string\n"); Vector<String> indexedProps = new Vector<String>(); for ( int i = 0; i < javaTypeNodes.getLength(); ++i ) { XSDElement javaTypeElement = new XSDElement((Element) javaTypeNodes.item(i)); diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java index aa03cd2..b54408d 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java @@ -329,10 +329,10 @@ public class YAMLfromOXMTest { sb.append(" name: Apache 2.0\n"); sb.append(" url: http://www.apache.org/licenses/LICENSE-2.0.html" + OxmFileProcessor.LINE_SEPARATOR); sb.append(" contact:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append(" name:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append(" url:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append(" email:" + OxmFileProcessor.LINE_SEPARATOR); - sb.append("host:" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" name: n/a" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" url: n/a" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" email: n/a" + OxmFileProcessor.LINE_SEPARATOR); + sb.append("host: n/a" + OxmFileProcessor.LINE_SEPARATOR); sb.append("basePath: /aai/v11" + OxmFileProcessor.LINE_SEPARATOR); sb.append("schemes:" + OxmFileProcessor.LINE_SEPARATOR); sb.append(" - https\n"); @@ -506,7 +506,7 @@ public class YAMLfromOXMTest { sb.append(" example: __GLOBAL-CUSTOMER-ID__\n"); sb.append(" - name: service-type\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); sb.append(" /business/customers/customer/{global-customer-id}:\n"); @@ -643,17 +643,17 @@ public class YAMLfromOXMTest { sb.append(" null parameters:\n"); sb.append(" - name: global-customer-id\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); sb.append(" - name: subscriber-name\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); sb.append(" - name: subscriber-type\n"); sb.append(" in: query\n"); - sb.append(" description:\n"); + sb.append(" description: n/a\n"); sb.append(" required: false\n"); sb.append(" type: string\n"); return sb.toString(); |