I'm working with a dropwizard app and one of the endpoints accepts JSON.
Currently, if a json object like this is passed as a POST or PUT request, using Postman for example, it holds onto the last values.
{
"key", "value1",
"key", "value2"
}
it gets deserialised into an object and then if a GET is performed, the response will be like this.
{
"key", "value2"
}
Dropwizard seems to deal with this by overriding the map with latest values.
I was wondering if there is a way to basically prevent JSON with duplicate keys from being accepted as part of the PUT request, and just give error back to user.
Any help much appreciated. Thanks