diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-10-25 14:56:26 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-10-25 15:41:20 +0200 |
commit | 616e19c4fe775efd611500c23856af69287c0a15 (patch) | |
tree | 0ad8753e8e4983ae91d0b4220b3b5f8f8107a326 | |
parent | e4b2c4461a1289e4be7bd533b983d658cb01a376 (diff) |
Openapi file is incorrect for array fields
Issue-ID: AAI-4038
Change-Id: Ib429c413452be401b9a9bb27c62ef8a2ae51bccc
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
-rw-r--r-- | aai-annotations/pom.xml | 2 | ||||
-rw-r--r-- | aai-queries/pom.xml | 2 | ||||
-rw-r--r-- | aai-schema-gen/pom.xml | 2 | ||||
-rw-r--r-- | aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java | 13 | ||||
-rw-r--r-- | aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java | 18 | ||||
-rw-r--r-- | aai-schema-service/pom.xml | 2 | ||||
-rw-r--r-- | aai-schema/pom.xml | 2 | ||||
-rw-r--r-- | pom.xml | 2 |
8 files changed, 29 insertions, 14 deletions
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 @@ public class YAMLfromOXM extends OxmFileProcessor { 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 @@ public class YAMLfromOXMTest { 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 @@ public class YAMLfromOXMTest { 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> @@ -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> |