Closed tmdgusya closed 1 year ago
I'll let @k163377 dig in deeper but it seems to me that this tries approach problem by work-around that is very specific to tested problem. Since usage works with POJOs (Java beans) it seems this should not be necessary; and specifically AnnotationIntrospector
should not try to deduce structural information (from enclosing class), ever. It should only get information as requested; it's caller (like BeanSerializerBuilder
/ -Factory
) that should compose information on inclusion to use.
So I'd be suspicious of using this to try to resolve the real problem in #625.
@cowtowncoder I understand your review. So this issue'll be assigned to @k163377 ?
@tmdgusya @k163377 is one of module maintainers (I am not) so I let him decide; I just added notes of my concerns.
I have created a PR summarizing the changes mentioned in my comment.
I am very sorry, but this PR is closed.
The problem of #625 will resolved by this P.R.
There is one more problem with that. If the ObjectMapper is configured with JsonInclude.Nonnull, then the ObjectMapper will not serialize the property. However, the ObjectMapper is serializing the property. I think it can be easily resolved if I know how to get the serializationInclusion values of the ObjectMapper in the KotlinModule class.