[jackson-dataformat-csv:2.8.11/2.12.2]CsvMapper unrecognised the @JsonProperty
See original GitHub issuethe result is
AppsFlyerRawDataBean.java.txt appsflyer-raw-data.csv
final CsvMapper mapper = new CsvMapper();
final CsvSchema schema = mapper.schemaFor(AppsFlyerRawDataBean.class);
final ObjectReader objectReader = mapper.readerFor(AppsFlyerRawDataBean.class).with(schema);
final Collection<AppsFlyerRawData> result = new ArrayList<>(20);
try (final Reader reader = new FileReader(csv)) {
final MappingIterator<AppsFlyerRawDataBean> records = objectReader.readValues(reader);
while (records.hasNextValue()) {
final AppsFlyerRawDataBean one = records.nextValue();
if (isBlank(one)) {
continue;
}
result.add(one);
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
java - Jackson with JSON: Unrecognized field, not marked as ...
I got the same error as the OP when I used an ObjectMapper from a different dependency as the JsonProperty annotation. This works:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @cowtowncoder ,
I recently came across that issue because I faced the same problem within one of my projects. I created a repo containing a (hopefully meaningful) test case.
https://github.com/sbszcz/jackson-csv-java-example
Mapping the content of the columns does not work. I have no idea why. The content seems to be mapped to arbitrary pojo properties.
Could you please have a look at this?
Thank you, Sebastian
At this point I don’t see actual bug to fix, but I want to help ensure that usage can be changed to work for the use case, so keeping issue open.