Open kenyee opened 3 years ago
Ok, first things first: would it be possible to minimize the example to include fewer columns?
Also, it'd be good to have unit test style assertions (write as a String, checkout output).
With a quick look usage looks correct: setting of SORT_PROPERTIES_ALPHABETICALLY
has no effect with explicit ordering.
Beyond this there are 2 possibilities:
jackson-module-kotlin
(since CSV format module does not and cannot depend on Kotlin module).It would be great if a simplified reproduction with Java-only usage could decide between (1) and (2).
To proceed any further, I will need to know whether this is Kotlin specific or not: the easiest way would be to provide Java-only reproduction.
Using Kotlin, defining a class like this:
And writing it out using:
Doesn't work...the order is not preserved. Workaround is to use the addColumn syntax to force the order:
Also had to use @field:JsonProperty...using just @JsonProperty and withHeaders() wrote out the field names instead of the @JsonProperty name.
Used: Kotlin 1.3.72 dataformats-csv 2.12.2 jackson 2.12.2