-
-
Notifications
You must be signed in to change notification settings - Fork 152
Closed
Labels
2.21csvhas-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue
Milestone
Description
(moved from FasterXML/jackson-dataformat-csv#116 by @georgewfraser)
When writing arrays to CSV, if there is a null, columns get written out of order. Reproduced in 2.7.1 with this test: https://gist.github.com/georgewfraser/164647fbaca61aadf9ee :
@Test
public void objectArray() throws IOException {
CsvSchema schema = CsvSchema.builder()
.addColumn("a", CsvSchema.ColumnType.NUMBER)
.addColumn("b", CsvSchema.ColumnType.NUMBER)
.setUseHeader(true)
.build();
ObjectWriter writer = Config.CSV.writer(schema);
StringWriter out = new StringWriter();
SequenceWriter sequence = writer.writeValues(out);
sequence.write(new Object[]{ 1, 2 });
sequence.write(new Object[]{ null, 2 });
sequence.write(new Object[]{ null, null });
sequence.write(new Object[]{ 1, null });
assertEquals("\"a\",\"b\"\n" +
"1,2\n" +
",2\n" +
",\n" +
"1,\n", out.toString());
}Metadata
Metadata
Assignees
Labels
2.21csvhas-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue