This is an automated email from the ASF dual-hosted git repository.

xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e9e01c022 [type:BUG] DocParameter example 
IllegalStateException(#5467) (#5470)
8e9e01c022 is described below

commit 8e9e01c02272dc436bacb2ee3d67b142af687cfb
Author: dyp314417995 <[email protected]>
AuthorDate: Wed Mar 27 17:40:46 2024 +0800

    [type:BUG] DocParameter example IllegalStateException(#5467) (#5470)
    
    Co-authored-by: xiaoyu <[email protected]>
    Co-authored-by: loongs-zhang <[email protected]>
    Co-authored-by: moremind <[email protected]>
---
 .../java/org/apache/shenyu/admin/model/bean/DocParameter.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/bean/DocParameter.java
 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/bean/DocParameter.java
index 72f6b52963..76fda58e79 100644
--- 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/bean/DocParameter.java
+++ 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/bean/DocParameter.java
@@ -18,9 +18,9 @@
 package org.apache.shenyu.admin.model.bean;
 
 import com.google.gson.annotations.SerializedName;
+import org.apache.commons.lang3.ObjectUtils;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.commons.lang3.StringUtils;
 
 /**
  * DocParameter.
@@ -44,7 +44,7 @@ public class DocParameter {
 
     private String description;
 
-    private String example = "";
+    private Object example = "";
 
     @SerializedName("x-example")
     private String xExample;
@@ -199,7 +199,7 @@ public class DocParameter {
      * @return String
      */
     public String getExample() {
-        return StringUtils.isBlank(example) ? xExample : example;
+        return ObjectUtils.isEmpty(example) ? xExample : example.toString();
     }
 
     /**
@@ -207,7 +207,7 @@ public class DocParameter {
      *
      * @param example example
      */
-    public void setExample(final String example) {
+    public void setExample(final Object example) {
         this.example = example;
     }
 

Reply via email to