Add alias to workaround issue with prefixes in outer tags 63/139563/1
authorDan Timoney <dtimoney@att.com>
Wed, 8 Jan 2025 20:04:02 +0000 (15:04 -0500)
committerDan Timoney <dtimoney@att.com>
Wed, 8 Jan 2025 20:04:56 +0000 (20:04 +0000)
To work around the issue with the response from ODL containing prefix in
only outer tag, use @JsonAlias annotation to define an alias value that
includes the module name for those tags where it is needed.

Issue-ID: SDNC-1852
Change-Id: I16a41cd05e7b3fe5fba0964fbc87a2889b353c10
Signed-off-by: Dan Timoney <dtimoney@att.com>
generic-resource-api/client/.swagger-codegen-ignore [new file with mode: 0644]
generic-resource-api/client/pom.xml
generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVfModuleTopology.java [new file with mode: 0644]
generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVnfTopology.java [new file with mode: 0644]

diff --git a/generic-resource-api/client/.swagger-codegen-ignore b/generic-resource-api/client/.swagger-codegen-ignore
new file mode 100644 (file)
index 0000000..188b064
--- /dev/null
@@ -0,0 +1,2 @@
+**/GenericResourceApiVfModuleTopology.java
+**/GenericResourceApiVnfTopology.java
index b19c457..6ff9c4a 100644 (file)
@@ -92,8 +92,8 @@
                         <groupId>com.fasterxml.jackson.jaxrs</groupId>
                         <artifactId>jackson-jaxrs-json-provider</artifactId>
                         <version>${jackson.version}</version>
-                    </dependency>
-                </dependencies>
+                        </dependency>
+                    </dependencies>
                 <executions>
                     <execution>
                         <goals>
                         <configuration>
                             <inputSpec>${project.basedir}/../model/swagger/src/main/yaml/${api.name}.yaml</inputSpec>
                             <language>spring</language>
+                            <ignoreFileOverride>${project.basedir}/.swagger-codegen-ignore</ignoreFileOverride>
                             <configOptions>
                                 <java8>true</java8>
                                 <withXml>true</withXml>
diff --git a/generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVfModuleTopology.java b/generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVfModuleTopology.java
new file mode 100644 (file)
index 0000000..9ace0d9
--- /dev/null
@@ -0,0 +1,92 @@
+package org.onap.sdnc.northbound.client.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduletopologyVfModuleTopology;
+import java.io.Serializable;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import javax.xml.bind.annotation.*;
+
+/**
+ * GenericResourceApiVfModuleTopology
+ */
+@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2025-01-08T14:16:16.769-05:00")
+@JacksonXmlRootElement(localName = "GenericResourceApiVfModuleTopology")
+@XmlRootElement(name = "GenericResourceApiVfModuleTopology")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class GenericResourceApiVfModuleTopology  implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  @JsonProperty("vf-module-topology")
+  @JsonAlias({"GENERIC-RESOURCE-API:vf-module-topology", "vf-module-topology"})
+  @JacksonXmlProperty(localName = "vf-module-topology")
+  private GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = null;
+
+  public GenericResourceApiVfModuleTopology vfModuleTopology(GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology) {
+    this.vfModuleTopology = vfModuleTopology;
+    return this;
+  }
+
+   /**
+   * Get vfModuleTopology
+   * @return vfModuleTopology
+  **/
+  @ApiModelProperty(value = "")
+
+  @Valid
+
+  public GenericResourceApiVfmoduletopologyVfModuleTopology getVfModuleTopology() {
+    return vfModuleTopology;
+  }
+
+  public void setVfModuleTopology(GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology) {
+    this.vfModuleTopology = vfModuleTopology;
+  }
+
+
+  @Override
+  public boolean equals(java.lang.Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    GenericResourceApiVfModuleTopology genericResourceApiVfModuleTopology = (GenericResourceApiVfModuleTopology) o;
+    return Objects.equals(this.vfModuleTopology, genericResourceApiVfModuleTopology.vfModuleTopology);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(vfModuleTopology);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("class GenericResourceApiVfModuleTopology {\n");
+    
+    sb.append("    vfModuleTopology: ").append(toIndentedString(vfModuleTopology)).append("\n");
+    sb.append("}");
+    return sb.toString();
+  }
+
+  /**
+   * Convert the given object to string with each line indented by 4 spaces
+   * (except the first line).
+   */
+  private String toIndentedString(java.lang.Object o) {
+    if (o == null) {
+      return "null";
+    }
+    return o.toString().replace("\n", "\n    ");
+  }
+}
+
diff --git a/generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVnfTopology.java b/generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVnfTopology.java
new file mode 100644 (file)
index 0000000..801785a
--- /dev/null
@@ -0,0 +1,92 @@
+package org.onap.sdnc.northbound.client.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyVnfTopology;
+import java.io.Serializable;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import javax.xml.bind.annotation.*;
+
+/**
+ * GenericResourceApiVnfTopology
+ */
+@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2025-01-08T10:24:30.980-05:00")
+@JacksonXmlRootElement(localName = "GenericResourceApiVnfTopology")
+@XmlRootElement(name = "GenericResourceApiVnfTopology")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class GenericResourceApiVnfTopology  implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  @JsonProperty("vnf-topology")
+  @JsonAlias({"GENERIC-RESOURCE-API:vnf-topology", "vnf-topology"})
+  @JacksonXmlProperty(localName = "vnf-topology")
+  private GenericResourceApiVnftopologyVnfTopology vnfTopology = null;
+
+  public GenericResourceApiVnfTopology vnfTopology(GenericResourceApiVnftopologyVnfTopology vnfTopology) {
+    this.vnfTopology = vnfTopology;
+    return this;
+  }
+
+   /**
+   * Get vnfTopology
+   * @return vnfTopology
+  **/
+  @ApiModelProperty(value = "")
+
+  @Valid
+
+  public GenericResourceApiVnftopologyVnfTopology getVnfTopology() {
+    return vnfTopology;
+  }
+
+  public void setVnfTopology(GenericResourceApiVnftopologyVnfTopology vnfTopology) {
+    this.vnfTopology = vnfTopology;
+  }
+
+
+  @Override
+  public boolean equals(java.lang.Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    GenericResourceApiVnfTopology genericResourceApiVnfTopology = (GenericResourceApiVnfTopology) o;
+    return Objects.equals(this.vnfTopology, genericResourceApiVnfTopology.vnfTopology);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(vnfTopology);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("class GenericResourceApiVnfTopology {\n");
+    
+    sb.append("    vnfTopology: ").append(toIndentedString(vnfTopology)).append("\n");
+    sb.append("}");
+    return sb.toString();
+  }
+
+  /**
+   * Convert the given object to string with each line indented by 4 spaces
+   * (except the first line).
+   */
+  private String toIndentedString(java.lang.Object o) {
+    if (o == null) {
+      return "null";
+    }
+    return o.toString().replace("\n", "\n    ");
+  }
+}
+