Skip to content
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

Support for ObjectMapper AUTO_DETECT_GETTERS and AUTO_DETECT_SETTERS set to false #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ineentho
Copy link

@ineentho ineentho commented Nov 8, 2022

Fixes #43

We had the same issue as #43, we create our ObjectMapper with these settings:

mapper = new ObjectMapper();
mapper.configure(MapperFeature.AUTO_DETECT_GETTERS, false);
mapper.configure(MapperFeature.AUTO_DETECT_SETTERS, false);
...

We can easily add support for this case to this library using the following annotation to all classes that are supposed to be (de)serialized using jackson and use getters/setters:

@JsonAutoDetect(getterVisibility = Visibility.PUBLIC_ONLY, setterVisibility = Visibility.PUBLIC_ONLY)

This will not affect existing users that are using the default values of AUTO_DETECT_*, as getterVisibility = Visibility.PUBLIC_ONLY and setterVisibility = Visibility.PUBLIC_ONLY are the defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

geojson-jackson does not work when AUTO_DETECT_GETTERS is set to false
1 participant