兼容jackjson中access中的READ_ONLY跟WRITE_ONLY修复 - #830
Merged
Conversation
Member
|
请签署CLA |
Contributor
Author
|
好的,签署了 |
Member
|
显示还没签署CLA,同时这个PR导致JsonPropertyTest1跑不过,这个Testcase也一起改了吧 |
Contributor
Author
|
好的,抱歉没看下方报错 |
Member
|
https://github.com/alibaba/fastjson2/releases/tag/2.0.16 |
|
JsonProperty.Access.WRITE_ONLY || access = JsonProperty.Access.READ_ONLY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it?
目前当系统使用到jackson跟fastjson2后,使用jackson
@JsonProperty(value = "password", access = JsonProperty.Access.WRITE_ONLY)
注解后,bean类序列化为json时返回前端不带password字段,该现象为正常的。
但通过JSON.parseObject(jsonObject.toJSONString(), SysUser.class);得到的bean中password为空
同时当user.setPassword("54321");System.out.println(JSON.toJSONString(user));时输出json中带password字段值
Summary of your change
对ObjectWriterBaseModule跟ObjectReaderBaseModule中字段对调
Please indicate you've done the following: