[
{
"id" : "Unique_Id25",
"firstName" : "Test Name",
"firstName" : "Test Name 2",
}
]
Above I have an example of a duplicate key, firstName
. I use Postman and it warns that a duplicate key exists, but the POST request passes as I don't currently validate for it.
So I'm asking if there's a cool java/spring way of checking for this duplicate and throwing an exception.
Otherwise I'll try to build these JSON keys into an array and looping through.