Skip to content

feat: ensure consistent validation for multiple fields with ordered iteration#313

Merged
inhere merged 1 commit into
gookit:masterfrom
almas-x:fix-284
Sep 8, 2025
Merged

feat: ensure consistent validation for multiple fields with ordered iteration#313
inhere merged 1 commit into
gookit:masterfrom
almas-x:fix-284

Conversation

@almas-x

@almas-x almas-x commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

resolve #284

Refactor validation rule iteration to use ordered traversal

This change ensures that when validating multiple fields (via StringRules and ConfigRules), rules are applied in a consistent, sorted order. The new OrderedRange method in MS enables deterministic rule processing, improving error reporting predictability and eliminating non-deterministic behavior caused by random map iteration.

@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 17547986735

Details

  • 13 of 15 (86.67%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.06%) to 96.833%

Changes Missing Coverage Covered Lines Changed/Added Lines %
validate.go 10 12 83.33%
Totals Coverage Status
Change from base Build 17511796677: -0.06%
Covered Lines: 2905
Relevant Lines: 3000

💛 - Coveralls

@inhere inhere merged commit f8efc82 into gookit:master Sep 8, 2025
10 of 11 checks passed
@almas-x almas-x deleted the fix-284 branch September 8, 2025 14:34
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.

Random error in validating required fields, returning error for only one field

3 participants