aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2025-01-08 15:04:02 -0500
committerDan Timoney <dtimoney@att.com>2025-01-08 20:04:56 +0000
commit42e61e5a3352d0e222e6a242b8f871cf6aa915b8 (patch)
treef1e70671c02cd1db536dc24a1c9d3c0f8151f494
parentb7775c9347e052942f7670fd01cc8101ecb72317 (diff)
Add alias to workaround issue with prefixes in outer tagsHEADmaster
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>
-rw-r--r--generic-resource-api/client/.swagger-codegen-ignore2
-rw-r--r--generic-resource-api/client/pom.xml5
-rw-r--r--generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVfModuleTopology.java92
-rw-r--r--generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVnfTopology.java92
4 files changed, 189 insertions, 2 deletions
diff --git a/generic-resource-api/client/.swagger-codegen-ignore b/generic-resource-api/client/.swagger-codegen-ignore
new file mode 100644
index 00000000..188b064e
--- /dev/null
+++ b/generic-resource-api/client/.swagger-codegen-ignore
@@ -0,0 +1,2 @@
+**/GenericResourceApiVfModuleTopology.java
+**/GenericResourceApiVnfTopology.java
diff --git a/generic-resource-api/client/pom.xml b/generic-resource-api/client/pom.xml
index b19c457e..6ff9c4ac 100644
--- a/generic-resource-api/client/pom.xml
+++ b/generic-resource-api/client/pom.xml
@@ -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>
@@ -102,6 +102,7 @@
<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
index 00000000..9ace0d9e
--- /dev/null
+++ b/generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVfModuleTopology.java
@@ -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
index 00000000..801785a9
--- /dev/null
+++ b/generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVnfTopology.java
@@ -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 ");
+ }
+}
+