I have a JSON file being parsed in java. It has several lists of objects like the following:
{
"phoneNumbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "fax",
"number": "646 555-4567"
}
]
}
It's a sensitive input file and overwriting duplicate entries is not an option. The program checks for duplicates using a for loop and maps when processing a particular list, but I want to check the entire file for dups in one go as the file is being parsed so that in case of error the program stops before running anything else.
I was wondering if there's a JSON parser for java out there that will detect duplicate object entries in the list and provide a message. Also, are there any parsers that will let you know if a declared object gets overwritten because another object with the same name is declared in the same file?