You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/08/09 08:58:24 UTC

[GitHub] [inlong] healchow commented on a diff in pull request #5426: [INLONG-5424][Manager] Fix json serialization for Authentication when get inlongGroupInfo

healchow commented on code in PR #5426:
URL: https://github.com/apache/inlong/pull/5426#discussion_r941083421


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/auth/Authentication.java:
##########
@@ -17,11 +17,20 @@
 
 package org.apache.inlong.manager.common.auth;
 
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.util.Locale;
 import java.util.Map;
 
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, visible = true, property = "type")
+@JsonSubTypes({
+        @JsonSubTypes.Type(value = DefaultAuthentication.class, name = DefaultAuthentication.DEFAULT),

Review Comment:
   It is recommended to specify its specific type through `@JsonTypeDefine` on the subclass, without adding all subclasses on the parent class - refer to the advice of the open-closed principle.



-- 
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: commits-unsubscribe@inlong.apache.org

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