JSON Representation of HashMap
It should be like this
{ "userPreferences":{"mobile":"yes","email":"yes"} }
"userPreferences":{"mobile":"yes","email":"yes"}
The JSON you have would be invalid even as a JavaScript object, since you haven't defined property names for the two "inner" objects. A HashMap
is basically a set of key-value pairs. Your JSON should look like:
"userPreferences": {
"mobile": "yes",
"email": "yes"
}