Skip to content

fix: duplicate labels with ignore-case - #1797

Merged
pierrecamilleri merged 11 commits into
mainfrom
fix/header-case
Jul 28, 2026
Merged

fix: duplicate labels with ignore-case#1797
pierrecamilleri merged 11 commits into
mainfrom
fix/header-case

Conversation

@pierrecamilleri

@pierrecamilleri pierrecamilleri commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Context

ignore-case (or header-case) is a dialect option that affects validation by ignoring the case of the header. It is not specific to a schema, but to a validation instruction.

It has subtle implications that were not correctly taken into account :

  • matching schema field and label should ignore case
  • it can introduce duplicate labels
  • it can introduce duplicate fields

This PR handle an existing bug, where duplicate labels are not detected under "ignore-case=True", and introduces a refactoring to avoid such bugs in the future.

Proposition

  • To correctly handle field and label matching, the matching is factorized into a LabelMatching class, which defines in one place the matching strategy.

@pierrecamilleri pierrecamilleri changed the title fix: correct account of ignore-case fix: duplicate labels with ignore-case Jul 28, 2026
@pierrecamilleri
pierrecamilleri merged commit 9d53938 into main Jul 28, 2026
10 checks passed
@pierrecamilleri
pierrecamilleri deleted the fix/header-case branch July 28, 2026 10:50
pierrecamilleri added a commit that referenced this pull request Jul 28, 2026
# Context 

follow-up to #1797, which handles duplicate labels when ignoring case. 
This PR handles ambiguous fields under "ignore-case=True", which were
silently ignored during validation.

# Fix 

Ambiguous fields under "ignore-case" raise now an error : there is no
obvious default behavior and the schema schould *not* be used with
"ignore-case=True" in this circumstances.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant