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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to