Created
March 21, 2019 16:02
-
-
Save zodvik/8a91d721932310c3d136dc5a2e956686 to your computer and use it in GitHub Desktop.
Jackson Objectmapper Defaults
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
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); | |
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); | |
mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); | |
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); | |
mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); | |
mapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); | |
mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE); | |
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); | |
mapper.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.ANY); | |
mapper.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.ANY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment