[
https://issues.apache.org/jira/browse/CAMEL-26975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18145214#comment-18145214
]
Claus Ibsen commented on CAMEL-26975:
-------------------------------------
Merged on main (4.24.0) by https://github.com/apache/camel/pull/30005
(5caacce824e8). Left open for the camel-4.22.x and camel-4.18.x backports
(fixVersions 4.22.3, 4.18.6).
_Claude Code on behalf of davsclaus_
> camel-csv: an empty header marshals Map rows as empty lines
> -----------------------------------------------------------
>
> Key: CAMEL-26975
> URL: https://issues.apache.org/jira/browse/CAMEL-26975
> Project: Camel
> Issue Type: Bug
> Components: camel-csv
> Affects Versions: 4.18.5, 4.22.2, 4.23.0
> Reporter: Federico Mariani
> Assignee: Federico Mariani
> Priority: Major
> Fix For: 4.18.6, 4.22.3, 4.24.0
>
>
> An empty {{header}} is taken as one fixed column named {{""}}, so a Map row
> is marshalled as a quoted empty header line followed by an empty line: the
> values are lost.
> {code:java}
> from("direct:start").to("dataformat:csv:marshal?header=");
> // or: .marshal(new CsvDataFormat().setHeader(""))
> // body Map {foo=abc, bar=123} gives "\"\"\r\n\r\n"
> {code}
> Expected: an empty or blank header is handled like no header (as the
> {{setHeader}} Javadoc says and CAMEL-17767 fixed), so the row is written as
> {{abc,123}}.
> Regression since 4.10.1/4.11.0: CAMEL-21734 (commit 7c8ba2ba9e60) takes the
> columns from the format header, which {{getActiveFormat}} sets to {{[""]}},
> and dropped the empty check of CAMEL-17767.
> _Claude Code on behalf of Federico Mariani_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)