I am mapping Object (i don't have control over) to jsonString, after mapping I get duplicate key-value pairs in the JSON,
example
{
"id":"123",
"email":"[email protected]",
"UserName":"someOne",
"EMAIL":"[email protected]"
}
the duplicate is exactly the same except that it is in uppercase letters.
I am trying to get a jsonInString format without the duplication. Something like this:
{
"id":"123",
"email":"[email protected]",
"UserName":"someOne"
}
I have tried
String jsonInStringWithOutDuplication=mapper.enable(
JsonParser.Feature.STRICT_DUPLICATE_DETECTION).writeValueAsString(users);
with no luck, any suggestions?