liubao68 commented on a change in pull request #1688: [SCB-1828] Support 
@JSONVIEW 
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1688#discussion_r404466862
 
 

 ##########
 File path: 
common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/param/BodyProcessorCreator.java
 ##########
 @@ -64,16 +67,34 @@
   public static class BodyProcessor implements ParamValueProcessor {
     protected JavaType targetType;
 
+    protected Class<?> serialViewClass;
+
     private boolean isString;
 
     protected boolean isRequired;
 
     public BodyProcessor(JavaType targetType, boolean isString, boolean 
isRequired) {
+      this(targetType, null, isString, isRequired);
+    }
+
+    public BodyProcessor(JavaType targetType, String serialViewClass, boolean 
isString, boolean isRequired) {
+      if (serialViewClass != null) {
+        try {
+          this.serialViewClass = Class.forName(serialViewClass);
+        } catch (Throwable e) {
+          //ignore
 
 Review comment:
   It's better to add a log and throw an exception. This is an invalid usage 
when happens that users need to know. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to