-
I have something like this: @Singleton
public class MyMapper implements ObjectMapperCustomizer {
@Override
public void customize(ObjectMapper mapper) {
// disables JsonAutoDetect for getters/setters/constructors
// and only auto detects fields for (de)serializing:
mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE);
mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
}
} Does |
Beta Was this translation helpful? Give feedback.
Answered by
geoand
Dec 31, 2024
Replies: 2 comments
-
/cc @geoand (jackson), @gsmet (jackson), @mariofusco (jackson) |
Beta Was this translation helpful? Give feedback.
0 replies
-
It will work if the objects are used by a known integration (like a return type of JAX-RS / Jakarta REST resource method). |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nimo23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It will work if the objects are used by a known integration (like a return type of JAX-RS / Jakarta REST resource method).
If it does not in your use case, then you can use
@RegisterForReflection