-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support @JsonAnyGetter with CSV #243
Comments
Couple of quick questions:
|
Looking at the test case, schema is generated for the POJO. But unfortunately this cannot really generate anything for So basically it is not clear who such values could be supported: they cannot work without some mechanism for declaring columns that should exist -- currently the way to do that would be to manually construct |
Thanks for the reply. If I understand the issue correctly, the problem is that the As a workaround I take the POJO generated Since the |
@MrBuddyCasino yes your understanding is correct: the schema (mapping between columnar position and property name) must exist for all values before they are written: although serialization could in theory append new columns at the end, it wouldn't be clear how deserialization side could determine these additions. If all output was always buffered it could be done by modifying schema, writing out headers, but Jackson operates incrementally and does not buffer entries (although there is buffering for a single row in case name/value pairs are written out of order). There are probably ways to improve handling wrt And finally, yes, this is something where documentation improvements would be useful. Some annotations do not work as well (or at all) with all backend formats. |
It seems the
@JsonAnyGetter
annotation is not supported for the CSV format.I made a runnable test case:
https://github.com/MrBuddyCasino/jackson-csv-bug
It fails with
com.fasterxml.jackson.dataformat.csv.CsvMappingException: Unrecognized column 'xxx': known columns: ["num"] (through reference chain: org.example.CsvTest$Entity["[anySetter]"])
The text was updated successfully, but these errors were encountered: