Skip to content

Conversation

@its-hammer-time
Copy link
Contributor

Summary

There's a small bug with the validator library where the options we're creating for the validator aren't the same that get passed to the internal validators. You can see on line 88 that we create a new options variable using the opts... that were passed in from the user. We then use that new options to create our validator; however, we then fallback and use the original opts... rather than the one we created.

The issue with the current approach is that it's not calling the NewValidationOptions function so we don't get any of the defaulting. We only have what the user gave us (which is likely nothing).

Really what this translates to is:

  1. Each validator gets its own schema cache. We're warming up the schema cache on line 103, but that's for the cache that was created for options. However, opts... likely doesn't have anything set so its cache will be either be null or empty.
  2. If the user is trying to set the RegexEngine, the core validator will use it correctly when it calls FindPaths. However, the internal validators also have some calls to FindPaths and they will pass is nil.

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.58%. Comparing base (cadff75) to head (7455a01).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #221   +/-   ##
=======================================
  Coverage   97.58%   97.58%           
=======================================
  Files          56       56           
  Lines        5176     5176           
=======================================
  Hits         5051     5051           
  Misses        125      125           
Flag Coverage Δ
unittests 97.58% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

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