freeznet commented on a change in pull request #10513:
URL: https://github.com/apache/pulsar/pull/10513#discussion_r630846029



##########
File path: 
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/JacksonConfigurator.java
##########
@@ -33,6 +36,20 @@
 
     public JacksonConfigurator() {
         mapper = ObjectMapperFactory.create();
+        setInterfaceDefaultMapperModule();
+    }
+
+    private void setInterfaceDefaultMapperModule() {
+        SimpleModule module = new SimpleModule("InterfaceDefaultMapperModule");
+
+        // we not specific @JsonDeserialize annotation in OffloadProcessStatus
+        // because we do not want to have jackson dependency in 
pulsar-client-admin-api
+        // In this case we use SimpleAbstractTypeResolver to map interfaces to 
impls
+        SimpleAbstractTypeResolver resolver = new SimpleAbstractTypeResolver();
+        resolver.addMapping(OffloadProcessStatus.class, 
OffloadProcessStatusImpl.class);

Review comment:
       @merlimat I have added a `SimpleAbstractTypeResolver` here, and will 
manually map interfaces with impl classes here.

##########
File path: 
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/JacksonConfigurator.java
##########
@@ -33,6 +36,20 @@
 
     public JacksonConfigurator() {
         mapper = ObjectMapperFactory.create();
+        setInterfaceDefaultMapperModule();
+    }
+
+    private void setInterfaceDefaultMapperModule() {
+        SimpleModule module = new SimpleModule("InterfaceDefaultMapperModule");
+
+        // we not specific @JsonDeserialize annotation in OffloadProcessStatus
+        // because we do not want to have jackson dependency in 
pulsar-client-admin-api
+        // In this case we use SimpleAbstractTypeResolver to map interfaces to 
impls
+        SimpleAbstractTypeResolver resolver = new SimpleAbstractTypeResolver();
+        resolver.addMapping(OffloadProcessStatus.class, 
OffloadProcessStatusImpl.class);

Review comment:
       @merlimat I have added a `SimpleAbstractTypeResolver` here, and will 
manually map interfaces with impl classes.




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


Reply via email to