Skip to content

Fix regex enforcement false negative bug#47

Open
hyzale wants to merge 1 commit into
LukasForst:masterfrom
hyzale:fix-regex-matching-false-negative
Open

Fix regex enforcement false negative bug#47
hyzale wants to merge 1 commit into
LukasForst:masterfrom
hyzale:fix-regex-matching-false-negative

Conversation

@hyzale

@hyzale hyzale commented Mar 3, 2023

Copy link
Copy Markdown

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