validator icon indicating copy to clipboard operation
validator copied to clipboard

[Validator] Fix NotBlank validator to treat whitespace-only strings as blank

Open lionelkimbs opened this issue 11 months ago • 0 comments

Problem: The NotBlank validator previously failed to recognize strings consisting solely of whitespace characters (e.g., " " or " ") as blank.

Solution: This PR updates the NotBlank validator's logic to treat strings that contain only whitespace characters as blank.

Key Changes: Updated the validation logic in the NotBlankValidator class to trim value if type is string, then proceed to current checking.

Testing: Comprehensive unit tests have been added to verify the correct behavior of the NotBlank validator with whitespace-only strings. All existing tests have been run to ensure that this change does not introduce regressions in other parts of the application.

lionelkimbs avatar Mar 04 '24 00:03 lionelkimbs