You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jussi Wallin (Jira)" <ji...@apache.org> on 2022/09/15 07:46:00 UTC
[jira] [Created] (CAMEL-18512) Camel Bindy, marshaling CSV with more fields than Model
Jussi Wallin created CAMEL-18512:
------------------------------------
Summary: Camel Bindy, marshaling CSV with more fields than Model
Key: CAMEL-18512
URL: https://issues.apache.org/jira/browse/CAMEL-18512
Project: Camel
Issue Type: Wish
Components: camel-bindy
Affects Versions: 3.18.2
Reporter: Jussi Wallin
Our project has a use-case for Bindy where we would like to define a Model POJO that has less fields than the resulting CSV would have. We tried to achieve this by defining a model with the proper annotations and using the "pos" parameter in the DataField annotations.
For example you might want to define one field at position 4 and another at position 6. The resulting CSV should then contain an empty field at position 5. We used BeanIO previously and it supported this use-case. Adding dummy fields is fine in simple cases but when a CSV exceeds 100 fields, of which a couple dozen are used, it becomes very cumbersome to handle.
Specifically the unmarshal obviously works fine, but we are trying to marshal in this case. We are transitioning to using Bindy for all CSV handling and ran into this problem. I believe this would be useful generally.
Sample project that illustrates this case: [https://github.com/jwwallin/bindy-csv-sample]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)