I am trying to hash a JSON object to check for changes. I am using a custom ObjectMapper:
public static final ObjectMapper mapper =
new ObjectMapper().configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)
.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true)
.configure(SerializationFeature.INDENT_OUTPUT, false)
.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)
.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"))
.registerModule(new JavaTimeModule());
This seems to work perfectly fine, but obviously doesn't work for arrays inside of the JSON object. My question is how can I go about handling the arrays during the mapping process to make sure they stay in the same order every time?