Right now I'm trying to parse incoming JSON that is in this format:
{
<email>: {
<name>: <string>, # setting value
...
},
...
}
For example:
{
"aaa@example.com": {
"statement": true
},
"bbb@example.com": {
"statement": false
}
}
I also will not know how many emails will be in this JSON. I am a little befuddled as to how you could get all these emails with Jackson without knowing the property name for this, and I was wondering if it was possible.
Here is my code so far:
public class GDPRConsent extends Model {
@JsonIgnore
private static final String GDPR_CONSENT = "gdprConsent";
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@Override
public String getId() {
return GDPR_CONSENT;
}
}
This question is not the same as the duplicate. I am looking to solve this without a key, I just have the emails not a key for all the emails.