Closed danielgtaylor closed 1 month ago
The changes introduce a new global variable ValidateStrictCasing
in validate.go
, which controls case sensitivity during validation. The validation logic has been updated to allow case-insensitive checks for map keys when this variable is disabled. Additionally, the error handling for unexpected properties has been modified to support case-insensitive checks. In validate_test.go
, the test structure has been enhanced to include setup and teardown functions, and new test cases have been added to validate case-insensitive handling.
File | Change Summary |
---|---|
validate.go | Introduced ValidateStrictCasing variable; modified validation logic for case-insensitive checks; updated error handling for unexpected properties. |
validate_test.go | Enhanced test structure with before and cleanup fields; added new test cases for case-insensitive property handling; updated TestValidate logic. |
Objective | Addressed | Explanation |
---|---|---|
Introduce case insensitivity for JSON tags (#577) | ✅ |
validate_test.go
related to schema transformations and validation logic are directly relevant to the modifications made in this PR, focusing on enhancing validation logic for case sensitivity.In the fields where data plays,
A rabbit hops through JSON ways.
With casing loose, it finds its way,
Validations bright, come what may!
Hooray for changes, let’s all cheer,
For every field, we hold so dear! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.90%. Comparing base (
52482f3
) to head (91ff308
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for the change.
This PR updates the field validation to use case-insensitive matches when validating input objects. This is done because:
Fixes #577.
Summary by CodeRabbit
New Features
Bug Fixes
Tests