You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/04/07 00:27:33 UTC

[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #1688: [SCB-1828] Support @JSONVIEW

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. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services