Skip to content

CSV header validation ignores ACCEPT_CASE_INSENSITIVE_PROPERTIES: add CsvReadFeature.CASE_INSENSITIVE_HEADERS #657

@polyoxidonium

Description

@polyoxidonium

After upgrading to Jackson 3.1.x, CSV parsing with schema-based deserialization
(schemaFor(...).withHeader().withColumnReordering(true)) fails when header
names differ only by case.

Example:

  • expected: temp_max
  • actual: TEMP_MAX

Error:
CsvReadException: Missing header column: ["temp_max"]

Mapper is configured with:
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)

Expected behavior:
Case-insensitive property matching should also apply during header validation,
so headers differing only in case should not be treated as missing.

Actual behavior:
Header validation is strictly case-sensitive and fails before databind phase.

Notes:

Question:
Is this intended behavior, or should case-insensitive matching be applied during
header/schema reconciliation as well?
We have a lot of parsers in place which are supposed to work also with case-insensitive headers, so this can cause a lot of production issues on our side.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions