3

I am trying to display POJO data to allow external users to get information about the necessary structure for a REST API using Swagger. However, I have run into an issue where a class that contains fields that are in all caps displays the information from the annotations in the correct case along with the description and length. However, it also duplicates the fields in all lower-case with no description, size, etc. at the end of the object.

I have done a text search through the entire repository and in no location are any of the fields referenced in lower-case, nor are they used in constructors, getters, or setters.

Can anyone tell me how I can get Swagger to only contain the upper-case fields? I have included the class file below. Apologies in advance for the formatting.

    import java.util.HashMap;
    import java.util.Map;
    import javax.validation.Valid;
    import javax.validation.constraints.NotNull;
    import com.fasterxml.jackson.annotation.JsonAnyGetter;
    import com.fasterxml.jackson.annotation.JsonAnySetter;
    import com.fasterxml.jackson.annotation.JsonIgnore;
    import com.fasterxml.jackson.annotation.JsonInclude;
    import com.fasterxml.jackson.annotation.JsonProperty;
    import com.fasterxml.jackson.annotation.JsonPropertyOrder;
    import io.swagger.annotations.ApiModel;
    import io.swagger.annotations.ApiModelProperty;
    
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonPropertyOrder({
            "TP_UNIQUE_NUM",
            "SENDER_ID",
            "TRANSMISSION_FORMAT",
            "RECEIVER_ID",
            "HEADER",
            "TP_TRANSMISSION_TYPE",
            "FILE_NAME",
            "TRANSMISSION_DATE_TIME",
            "TRANSACTION_COUNT"
    })
    @ApiModel("SkuEnvelope")
    public class Envelope {
    
    
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("TP_UNIQUE_NUM")
        @NotNull
        @ApiModelProperty(value="Unique number to represent this transaction.", required=true,        example="T2007PL01158916", allowableValues="range[-infinity,50]")
        private String TPUNIQUENUM;
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("SENDER_ID")
        @NotNull
        @ApiModelProperty(value="Unique identifier representing the sender.", required=true,        example="1669", allowableValues="range[-infinity,50]")
        private String SENDERID;
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("TRANSMISSION_FORMAT")
        @NotNull
        @ApiModelProperty(value="The format of the data being sent", required=true, example="JSON",        allowableValues="range[-infinity,50]")
        private String TRANSMISSIONFORMAT;
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("RECEIVER_ID")
        @NotNull
        @ApiModelProperty(value="The unique identifier of the receiver.", required=true, example="MYNAME", allowableValues="range[-infinity,50]")
        private String RECEIVERID;
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("HEADER")
        @Valid
        @NotNull
        private com.xpo.sc.cmx.rest.sku2.HEADER HEADER;
        /**
                 *
         * (Required)
         *
         */
        @JsonProperty("TP_TRANSMISSION_TYPE")
        @NotNull
        @ApiModelProperty(value="The transaction type being sent.", required=true, example="ITEM",         allowableValues="range[-infinity,50]")
        private String TPTRANSMISSIONTYPE;
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("FILE_NAME")
        @NotNull
        @ApiModelProperty(value="The name of the file that the data is coming from. May be used to         find the data later.", required=false, example="Test_File.json", allowableValues="range[-        infinity,50]")
        private String FILENAME;
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("TRANSMISSION_DATE_TIME")
        @NotNull
        @ApiModelProperty(value="The time that the transmission occurs. Should be in the format         provided by the example", required=true, example="23/02/2021 03:34:56 PM", allowableValues="range[-        infinity,50]")
        private String TRANSMISSIONDATETIME;
        /**
         *
         * (Required)
         *
         */
        @JsonProperty("TRANSACTION_COUNT")
        @NotNull
        @ApiModelProperty(value="The number of documents sent in this transaction. Typically is 1",         required=true, example="1", allowableValues="range[-infinity,50]")
        private String TRANSACTIONCOUNT;
    
        @JsonIgnore
        @Valid
        private Map<String, Object> additionalProperties = new HashMap<String, Object>();
    
        /**
         * No args constructor for use in serialization
         *
         */
        public Envelope() {
        }
    
        public String getTPUNIQUENUM() {
            return TPUNIQUENUM;
        }
    
        public void setTPUNIQUENUM(String TPUNIQUENUM) {
            this.TPUNIQUENUM = TPUNIQUENUM;
        }
    
        public String getSENDERID() {
            return SENDERID;
        }
    
        public void setSENDERID(String SENDERID) {
            this.SENDERID = SENDERID;
        }
    
        public String getTRANSMISSIONFORMAT() {
            return TRANSMISSIONFORMAT;
        }
    
        public void setTRANSMISSIONFORMAT(String TRANSMISSIONFORMAT) {
            this.TRANSMISSIONFORMAT = TRANSMISSIONFORMAT;
        }
    
        public String getRECEIVERID() {
            return RECEIVERID;
        }
    
        public void setRECEIVERID(String RECEIVERID) {
            this.RECEIVERID = RECEIVERID;
        }
    
        public com.xpo.sc.cmx.rest.sku2.HEADER getHEADER() {
            return HEADER;
        }
    
        public void setHEADER(com.xpo.sc.cmx.rest.sku2.HEADER HEADER) {
            this.HEADER = HEADER;
        }
    
        public String getTPTRANSMISSIONTYPE() {
            return TPTRANSMISSIONTYPE;
        }
    
        public void setTPTRANSMISSIONTYPE(String TPTRANSMISSIONTYPE) {
            this.TPTRANSMISSIONTYPE = TPTRANSMISSIONTYPE;
        }
    
        public String getFILENAME() {
            return FILENAME;
        }
    
        public void setFILENAME(String FILENAME) {
            this.FILENAME = FILENAME;
        }
    
        public String getTRANSMISSIONDATETIME() {
            return TRANSMISSIONDATETIME;
        }
    
        public void setTRANSMISSIONDATETIME(String TRANSMISSIONDATETIME) {
            this.TRANSMISSIONDATETIME = TRANSMISSIONDATETIME;
        }
    
        public String getTRANSACTIONCOUNT() {
            return TRANSACTIONCOUNT;
        }
    
        public void setTRANSACTIONCOUNT(String TRANSACTIONCOUNT) {
            this.TRANSACTIONCOUNT = TRANSACTIONCOUNT;
        }
    
        public void setAdditionalProperties(Map<String, Object> additionalProperties) {
            this.additionalProperties = additionalProperties;
        }
    
        @JsonAnyGetter
        public Map<String, Object> getAdditionalProperties() {
            return this.additionalProperties;
        }
    
        @JsonAnySetter
        public void setAdditionalProperty(String name, Object value) {
            this.additionalProperties.put(name, value);
        }
        
        }
KM529
  • 372
  • 4
  • 17

0 Answers0