question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[jackson-dataformat-csv:2.8.11/2.12.2]CsvMapper unrecognised the @JsonProperty

See original GitHub issue

the result is image

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:open
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sbszczcommented, Jun 15, 2021

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

0reactions
cowtowncodercommented, Jul 9, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found