[Q/A][Java SDK (apache/dubbo)] dubbo 3.2.x use fastjson2 serialization will be ambiguity on @JSONField(serialize = false) fields #14203
Unanswered
hardtolose
asked this question in
Question
Replies: 1 comment
-
No, this is the limitation of fastjson2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Pre-check
Apache Dubbo Component
Java SDK (apache/dubbo)
Details
I use fastjson serialization in my spring mvc.
Some of my dto are return from dubbo service directly, some fields I don't want them to be visible from mvc api, so I add @JSONField(serialize = false) on these fields.
Those fields are just invisible when the dto serialized, in the consumer program they are still visible, and I can use them to do something.
But when I upgrade dubbo to 3.2.x, It use fastjson2 serialization by default, and Those fileds become invisible in the consumer program.
@JSONField(serialize = false) for my scene has two behaviors, 1. in program I want it visible, 2. in mvc api I want it invisible
I use
dubbo.provider.prefer-serialization=hessian2
to slove this problem temporary.Is there any way to compatible with both scenarios perfectly?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions