Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Unexpected output with arrays starting with a null/empty element #90

@cheseaux

Description

@cheseaux

Take this small example :

public class MyPojo {

    public String[] getVal1() {
        return new String[]{"", "foo"};
    }

    public String[] getVal2() {
        return new String[]{null, "bar"};
    }

    public String[] getVal3() {
        return new String[]{"baz",null};
    }

    public static void main(String[] args) throws JsonProcessingException {
        MyPojo jacksonBug = new MyPojo();
        CsvMapper mapper = new CsvMapper();
        String csvContent = mapper.writer(mapper.schemaFor(MyPojo.class).withHeader()).writeValueAsString(jacksonBug);
        System.out.println(csvContent);
    }

}

Output is :

val1,val2,val3
foo,bar,baz;

But should be :

val1,val2,val3
;foo,;bar,baz;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions