You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "xiaoheitalk (via GitHub)" <gi...@apache.org> on 2023/08/23 10:17:39 UTC
[GitHub] [dubbo] xiaoheitalk commented on issue #12580: dubbo3通过http协议对接问题
xiaoheitalk commented on issue #12580:
URL: https://github.com/apache/dubbo/issues/12580#issuecomment-1689693866
>
> 问题:[Why jackson is serializing transient member also?](https://stackoverflow.com/questions/21745593/why-jackson-is-serializing-transient-member-also) 解决:jackson序列化协议通过定义MetadataInfoMixin & JsonIgnore忽略字段或者关闭get方法的可见性 https://github.com/apache/dubbo-spi-extensions/blob/master/dubbo-rpc-extensions/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java#L117
>
> ```java
> # 方案1 重新定义JsonIgnore字段
> #mapper.addMixIn(MetadataInfo.class, MetadataInfoMixIn.class);
> #mapper.addMixIn(MetadataInfo.ServiceInfo.class, ServiceInfoMixIn.class);
> # 方案2 关闭get方法的可见性
> mapper.setVisibilityChecker(
> mapper.getSerializationConfig()
> .getDefaultVisibilityChecker()
> .withFieldVisibility(JsonAutoDetect.Visibility.ANY)
> .withGetterVisibility(JsonAutoDetect.Visibility.NONE)
> );
> ```
试了你提供的方案,没有解决。这个jsonrpc协议你解决了吗
--
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