From 1a7b9ce3b48d19861e346886a95838387d215e14 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 8 Jan 2025 15:04:02 -0500 Subject: Add alias to workaround issue with prefixes in outer tags 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 --- .../client/.swagger-codegen-ignore | 2 + generic-resource-api/client/pom.xml | 5 +- .../model/GenericResourceApiVfModuleTopology.java | 92 ++++++++++++++++++++++ .../model/GenericResourceApiVnfTopology.java | 92 ++++++++++++++++++++++ 4 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 generic-resource-api/client/.swagger-codegen-ignore create mode 100644 generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVfModuleTopology.java create mode 100644 generic-resource-api/client/src/main/java/org/onap/sdnc/northbound/client/model/GenericResourceApiVnfTopology.java 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 0e447cce..0545030a 100644 --- a/generic-resource-api/client/pom.xml +++ b/generic-resource-api/client/pom.xml @@ -92,8 +92,8 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson.version} - - + + @@ -102,6 +102,7 @@ ${project.basedir}/../model/swagger/src/main/yaml/${api.name}.yaml spring + ${project.basedir}/.swagger-codegen-ignore true true 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 "); + } +} + -- cgit 1.2.3-korg