You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "CrazyHZM (via GitHub)" <gi...@apache.org> on 2023/08/22 03:17:16 UTC

[GitHub] [dubbo] CrazyHZM commented on a diff in pull request #12910: 【OSPP】Json check compatiblity

CrazyHZM commented on code in PR #12910:
URL: https://github.com/apache/dubbo/pull/12910#discussion_r1300858252


##########
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/RestProtocol.java:
##########
@@ -113,6 +122,15 @@ public void afterUnExport() {
         return exporter;
     }
 
+    private void checkJsonCompatibility(Class<?> clazz) throws RpcException {
+        boolean compatibility = JsonCompatibilityUtil.checkClassCompatibility(clazz);
+        if (!compatibility) {
+            List<String> unsupportedMethods = JsonCompatibilityUtil.getUnsupportedMethods(clazz);
+            logger.error("Interface {} does not support json serialization, the specific methods are {}", clazz, unsupportedMethods);
+            throw new RpcException(String.format("Interface %s does not support json serialization", clazz));

Review Comment:
   Print logs or affect startup, should be decided by the user, it should be a configuration, configuration json check levels can be ignore (no check), log, startup error, respectively can correspond to close, alarm, strict
   



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org