Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

1.2.83@JSONField如果加在方法上会导致序列化后的结果使用该方法的值 #4393

Open
melodyplayer opened this issue May 16, 2023 · 0 comments

Comments

@melodyplayer
Copy link

当在一个方法上加注解@JSONField之后,序列化结果会把这个方法的返回值作为结果。
image
image

但是当在两个方法上加注解@JSONField之后,序列化结果会变成默认枚举值。
image
image

1.2.83版本想做新功能,自定义返回枚举的序列化结果值,这个想法是值得鼓励的,不过不应该使用老版本已经存在的@JSONField注解,这样同一个注解承担了两个职责,会导致老版本方法中使用@JSONField直接升级后序列化结果出错,新增一个注解承担这个功能会好一些。

@melodyplayer melodyplayer changed the title 1.2.83@JSONField如果加在方法上会导致序列化后的结果试用该方法的值 1.2.83@JSONField如果加在方法上会导致序列化后的结果使用该方法的值 May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant