Openapi file is incorrect for array fields

Issue-ID: AAI-4038
Change-Id: Ib429c413452be401b9a9bb27c62ef8a2ae51bccc
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
diff --git a/aai-annotations/pom.xml b/aai-annotations/pom.xml
index 09b592d..01f908e 100644
--- a/aai-annotations/pom.xml
+++ b/aai-annotations/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.schema-service</groupId>
         <artifactId>schema-service</artifactId>
-        <version>1.12.5-SNAPSHOT</version>
+        <version>1.12.6-SNAPSHOT</version>
     </parent>
     <artifactId>aai-annotations</artifactId>
     <name>aai-annotations</name>
diff --git a/aai-queries/pom.xml b/aai-queries/pom.xml
index 51a8213..82381eb 100644
--- a/aai-queries/pom.xml
+++ b/aai-queries/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.schema-service</groupId>
         <artifactId>schema-service</artifactId>
-        <version>1.12.5-SNAPSHOT</version>
+        <version>1.12.6-SNAPSHOT</version>
     </parent>
     <artifactId>aai-queries</artifactId>
     <name>aai-queries</name>
diff --git a/aai-schema-gen/pom.xml b/aai-schema-gen/pom.xml
index eb1247e..3fc0b86 100644
--- a/aai-schema-gen/pom.xml
+++ b/aai-schema-gen/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.schema-service</groupId>
         <artifactId>schema-service</artifactId>
-        <version>1.12.5-SNAPSHOT</version>
+        <version>1.12.6-SNAPSHOT</version>
     </parent>
     <artifactId>aai-schema-gen</artifactId>
     <name>aai-schema-gen</name>
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 55767c3..577846c 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
@@ -451,8 +451,17 @@
                                 System.out.println(
                                     v + "-relationship added as array for getItemName null");
                             }
-                            sbProperties.append("        type: array\n        items:\n");
-                            sbProperties.append("          $ref: \"#/definitions/")
+                            // https://gitlab.devops.telekom.de/tnap/development/tesla-team/portal-tnap/portal-bff/-/merge_requests/542/diffs#c00bf90500eca6b5dfcf2b014e51dace6aafeeba
+                            // type: object
+                            // properties:
+                            //   itemName:
+                            //     type: array
+                            //     items:
+                            //       $ref: "#/definitions/itemName"
+                            sbProperties.append("        type: object\n        properties:\n");
+                            sbProperties.append("          " + itemName + ":\n");
+                            sbProperties.append("            type: array\n            items:\n");
+                            sbProperties.append("              $ref: \"#/definitions/")
                                 .append("".equals(itemName) ? "inventory-item-data" : itemName)
                                 .append("\"\n");
                         }
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 774b760..f04b351 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
@@ -716,9 +716,12 @@
         sb.append("      Namespace for business related constructs\n");
         sb.append("    properties:\n");
         sb.append("      customers:\n");
-        sb.append("        type: array\n");
-        sb.append("        items:\n");
-        sb.append("          $ref: \"#/definitions/customer\"\n");
+        sb.append("        type: object\n");
+        sb.append("        properties:\n");
+        sb.append("          customer:\n");
+        sb.append("            type: array\n");
+        sb.append("            items:\n");
+        sb.append("              $ref: \"#/definitions/customer\"\n");
         sb.append("  customer:\n");
         sb.append("    description: |\n");
         sb.append("      customer identifiers to provide linkage back to BSS information.\n");
@@ -749,9 +752,12 @@
         sb.append(
             "        description: Used for optimistic concurrency.  Must be empty on create, valid on update and delete.\n");
         sb.append("      service-subscriptions:\n");
-        sb.append("        type: array\n");
-        sb.append("        items:\n");
-        sb.append("          $ref: \"#/definitions/service-subscription\"\n");
+        sb.append("        type: object\n");
+        sb.append("        properties:\n");
+        sb.append("          service-subscription:\n");
+        sb.append("            type: array\n");
+        sb.append("            items:\n");
+        sb.append("              $ref: \"#/definitions/service-subscription\"\n");
         sb.append("  customers:\n");
         sb.append("    description: |\n");
         sb.append(
diff --git a/aai-schema-service/pom.xml b/aai-schema-service/pom.xml
index 650ba43..d0d6627 100644
--- a/aai-schema-service/pom.xml
+++ b/aai-schema-service/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.aai.schema-service</groupId>
         <artifactId>schema-service</artifactId>
-        <version>1.12.5-SNAPSHOT</version>
+        <version>1.12.6-SNAPSHOT</version>
     </parent>
     <groupId>org.onap.aai.schema-service</groupId>
     <artifactId>aai-schema-service</artifactId>
diff --git a/aai-schema/pom.xml b/aai-schema/pom.xml
index 8a0289c..edc2d2f 100644
--- a/aai-schema/pom.xml
+++ b/aai-schema/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.schema-service</groupId>
         <artifactId>schema-service</artifactId>
-        <version>1.12.5-SNAPSHOT</version>
+        <version>1.12.6-SNAPSHOT</version>
     </parent>
     <artifactId>aai-schema</artifactId>
     <name>aai-schema</name>
diff --git a/pom.xml b/pom.xml
index 9fc6877..97e9534 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
     </parent>
     <groupId>org.onap.aai.schema-service</groupId>
     <artifactId>schema-service</artifactId>
-    <version>1.12.5-SNAPSHOT</version>
+    <version>1.12.6-SNAPSHOT</version>
     <name>aai-schema-service</name>
     <packaging>pom</packaging>
     <modules>