为什么swagger要复制ui中的字段

pdsfdshx  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(254)

我正在尝试显示pojo数据,以允许外部用户使用swagger获取有关restapi所需结构的信息。但是,我遇到了这样一个问题:包含所有大写字段的类以正确的大小写显示注解中的信息以及说明和长度。但是,它也会复制所有小写的字段,在对象末尾没有描述、大小等。
我已经在整个存储库中进行了文本搜索,没有任何位置的字段以小写形式引用,也没有在构造函数、getter或setter中使用。
有人能告诉我如何让swagger只包含大写字段吗?我已经把班级档案放在下面了。提前为格式化道歉。

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);
        }

        }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题