Skip to content

fix: skip case-variant validation when ValidateStrictCasing is set - #1176

Merged
robtme merged 1 commit into
mainfrom
fix/strict-casing-variants
Nov 21, 2026
Merged

robtme merged 1 commit into
mainfrom
fix/strict-casing-variants

Conversation

@robtme

@robtme robtme commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Since #1172, case-variant keys are validated against their property even with ValidateStrictCasing = true, so an API with a case-sensitive decoder (e.g. encoding/json/v2) and open schemas rejects keys its decoder ignores. This skips that check under strict casing, restoring the 2.40.0 behavior there.

Fixes #1175.

Strict casing tells the validator that keys only match a property by
exact name, as with a case-sensitive decoder. Validating case variants
against the property rejected keys such a decoder ignores.

Fixes #1175.
@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.09%. Comparing base (1177820) to head (f420e1f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1176   +/-   ##
=======================================
  Coverage   95.08%   95.09%           
=======================================
  Files          30       30           
  Lines        5885     5886    +1     
=======================================
+ Hits         5596     5597    +1     
  Misses        284      284           
  Partials        5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@robtme
robtme merged commit 34c1966 into main Nov 21, 2026
7 checks passed
@robtme
robtme deleted the fix/strict-casing-variants branch November 21, 2026 19:08
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.

ValidateStrictCasing: v2.41.0 rejects case-variant keys that a case-sensitive decoder ignores

1 participant