Skip to content

Correcting and clarifying RegularExpressionAttribute.IsValid #8165

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

daiplusplus
Copy link
Contributor

Summary

  • RegularExpressionValidator.IsValid does not throw ValidationException
  • Adding remark that Object? values are converted to a String using Convert.ToString which I found a tad surprising (as instead I expected it to throw if a non-null, non-string argument was passed).
  • Adding remark about how null and empty strings are considered valid.

Fixes #8164

Jehoel added 2 commits June 15, 2022 04:13
* `RegularExpressionValidator.IsValid` does not throw `ValidationException`
* Adding remark that `Object?` values are converted to a `String` using `Convert.ToString` which I found a tad surprising (as instead I expected it to throw if a non-null, non-string argument was passed).
Adding remark about null and empty strings.
@ghost
Copy link

ghost commented Jun 15, 2022

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Issue Details

Summary

  • RegularExpressionValidator.IsValid does not throw ValidationException
  • Adding remark that Object? values are converted to a String using Convert.ToString which I found a tad surprising (as instead I expected it to throw if a non-null, non-string argument was passed).
  • Adding remark about how null and empty strings are considered valid.

Fixes #8164

Author: Jehoel
Assignees: -
Labels:

area-System.Text.RegularExpressions

Milestone: -

@daiplusplus daiplusplus changed the title Regexattrib Correcting and clarifying RegularExpressionAttribute.IsValid Jun 15, 2022
@opbld30
Copy link

opbld30 commented Jun 15, 2022

Docs Build status updates of commit 161a4da:

⚠️ Validation status: warnings

File Status Preview URL Details
xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml ⚠️Warning View Details

xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml

  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'System.Convert.ToString(object?,IFormatProvider?)'.

For more details, please refer to the build report.

If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@opbld31
Copy link

opbld31 commented Jun 15, 2022

Docs Build status updates of commit 04da9eb:

✅ Validation status: passed

File Status Preview URL Details
xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@ghost
Copy link

ghost commented Jun 16, 2022

Tagging subscribers to this area: @ajcvickers
See info in area-owners.md if you want to be subscribed.

Issue Details

Summary

  • RegularExpressionValidator.IsValid does not throw ValidationException
  • Adding remark that Object? values are converted to a String using Convert.ToString which I found a tad surprising (as instead I expected it to throw if a non-null, non-string argument was passed).
  • Adding remark about how null and empty strings are considered valid.

Fixes #8164

Author: Jehoel
Assignees: -
Labels:

area-System.ComponentModel.DataAnnotations

Milestone: -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RegularExpressionAttribute.IsValid has incorrect Exceptions section
5 participants