Don't include "nullVersion" in swagger API
Swagger sitll uses jackson, thus it is including
ToscaPolicyIdentifierOptVersion.isNullVersion() in the API that it
generates. Added @JsonIgnore annotation to prevent it from being
included. Similar issue with get/setVersion() in PdpGroup.
Created POLICY-1653 to remove the isNullVersion() method altogether in
El Alto.
Change-Id: I6cb7b7d1d75258eeb9d6f9b6c7a48eeb32174307
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
index 4cb0ac5..8cad58c 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroup.java
@@ -21,6 +21,7 @@
package org.onap.policy.models.pdp.concepts;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
@@ -121,12 +122,14 @@
}
@Override
+ @JsonIgnore
public String getVersion() {
// We need to pass a version for keying in the database
return PfKey.NULL_KEY_VERSION;
}
@Override
+ @JsonIgnore
public void setVersion(String version) {
// Just ignore any version that is set
}
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
index adfd616..a6aec08 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
@@ -20,6 +20,7 @@
package org.onap.policy.models.tosca.authorative.concepts;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -61,6 +62,7 @@
*
* @return {@code true} if the version is null/missing, {@code false}
*/
+ @JsonIgnore
public boolean isNullVersion() {
return (version == null);
}