Reputation: 83
I'm using jackson csv to parse a csv as pojo
ID,requestId,requestSource,documentIds,trackingIds
documentIds,123456,CLAIMS,123456;223456,
->
@Data
@NoArgsConstructor
@JacksonXmlRootElement(localName = "triggerDocumentExport",namespace = Connection.NAMESPACE_CAS)
public class TriggerDocumentExport {
private Wrapper in;
public TriggerDocumentExport(Wrapper in){this.in = in;}
@Data
public static class Wrapper{
private String requestId,
requestSource;
private List<String> documentIds,
trackingIds;
}
}
I want documentIds to be parsed as a List<String>, with default ArrayElementSeparator(which is ;)
but it keeps parsing it as a single string "123456;223456"
without DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, I got an exception
with the configuration, I got a List with only one element "123456;223456"
If I don't make mistake, should jackson csv support semicolon-seperated list by default?Or there's something I've misunderstood.
Upvotes: 1
Views: 809