Skip to content
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 regex enforcement false negative bug #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hyzale
Copy link

@hyzale hyzale commented Mar 3, 2023

For @RegularExpression enforcement, the existing use of containsMatchIn is problematic in that it allows unwanted strings.

For example, with Request(@RegularExpression("[0-9]{4}") val fourDigits: String), unwanted string "12345" can pass the validation unexpectedly.

This PR also contains a test for the described issue too. I'm not sure if there's a better way and better place to test this enforcement within the exiting test files, so feel free to let me know if any exiting file can host this test case better!

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