I have a Yaml document that includes map entries that correspond to lists. Here's an example:
environments:
qa: [ 'us-east-1' ]
staging: [ 'us-east-1', 'us-west-2' ]
Run Code Online (Sandbox Code Playgroud)
I am using Jackson 2.3.2 to parse the document into a class using the following field & accessors:
private Map<String, List<String>> environments = new HashMap<String, List<String>>();
@JsonProperty
public Map<String, List<String>> getEnvironments() {
return environments;
}
@JsonProperty
public void setEnvironments(Map<String, List<String>> environments) {
this.environments = environments;
}
Run Code Online (Sandbox Code Playgroud)
I'm testing the reading of the Yaml file …