-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: pass validator config options when validating OpenAPI doc #132
fix: pass validator config options when validating OpenAPI doc #132
Conversation
@daveshanley Can you provide some feedback on this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, thank you for finding this gap!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
=======================================
Coverage ? 99.74%
=======================================
Files ? 29
Lines ? 3167
Branches ? 0
=======================================
Hits ? 3159
Misses ? 8
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
LGTM, resolve the conflict with the go.mod (I just merged in some dependabot PRs). Thank you for your contribution! |
df7e605
to
510d30d
Compare
@daveshanley updated. Thank you! |
Currently, when initializing validator.NewValidator with a custom regex engine, that engine is not passed down to the
ValidateDocument()
function.For example:
In this case, although config.WithRegexEngine(customRegexEngine) is provided during initialization, it is not used during validation, because ValidateDocument() does not forward the option.
This PR resolves the issue by ensuring v.options.RegexEngine is passed into ValidateOpenAPIDocument using the config.WithRegexEngine option. This ensures that any custom regex engine specified during initialization is correctly applied when validating OpenAPI documents.