Open
Description
as reported here http://stackoverflow.com/questions/24569318/writing-multi-line-csv-with-jacksonrepresentation, the current JacksonRepresentation does not take into account correctly the serialization of collection of beans to CSV format.
The objectWriter is not correctly set, and in addition it can't be correctly overriden by specifying the csv schema.
As workaround:
rep = new JacksonRepresentation<MyBean[]>(MediaType.TEXT_CSV, tab) {
@Override
protected ObjectWriter createObjectWriter() {
CsvMapper csvMapper = (CsvMapper) getObjectMapper();
CsvSchema csvSchema = csvMapper.schemaFor(MyBean.class);
ObjectWriter result = csvMapper.writer(csvSchema);
return result;
}
};