-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JsonIgnoreProperties.allowSetters
is not working in Jackson 2.8
#1595
Comments
I can not reproduce the issue with 2.8.8; but maybe I don't understand what the problem is? One possibility is that fix for #1345 or #1575 (both included in 2.8.8) could maybe have resolved this issue. |
I expect the output to be "password", but is "null" 当allowSetters为true时,我认为应该是可以从String中反序列化的. |
@anywnyu what I was saying was that this is not what I see with version 2.8.8: |
My version is 2.8.8, |
@anywnyu at this I can not reproduce this -- without functioning unit test there is nothing I can do. |
@cowtowncoder
我使用的是2.8.8版本. 我debug发现下面的代码并未区分allowSetters是否为true,所有JsonIgnoreProperties定义的字段都被忽略了.在循环处理的字段中没有包含password.
com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.filterBeanProps(DeserializationContext, BeanDescription, BeanDeserializerBuilder, List, Set): Line603 |
@anywnyu I am not going to spend any time running various things, except for one specific thing: failing unit test. That is, class that has a JUnit test case, and one that fails. If that is provided, please re-open. |
the issue exsits. |
@runjia1987 我的英文不怎么样,没看太明白. |
@anywnyu, a simple case below, should surely reproduce this issue.
test class:
build.gradle:
switch between the jackson versions in gradle, u will see the 2.8.x behaves wrong. |
@runjia1987 It is almost unit test; all that it lacks are assertions. Printing values out is not a test. However: what are |
@cowtowncoder
|
@runjia1987 Thank you. Lombok depedency is specifically not accepted for Jackson unit tests (due to it not working solely via Maven, requires add'l installation), and definition of stand-alone test is that code works as-is. At this point test seems almost complete. I hope to find time to look into this at some point. |
JsonIgnoreProperties.allowSetters
is not working in Jackson 2.8
@anywnyu @runjia1987 Thank you for reporting this: looks like it was a regression from 2.7 due to refactoring of annotation handling. Fix will be in 2.8.9 patch release. |
the version is 2.8.7.
the password cannot deserialize.
the output is:
{"username":"user"}
null
The text was updated successfully, but these errors were encountered: