dotnet / dotnet/dotnet-api-docs
RegularExpressionAttribute.IsValid has incorrect Exceptions section
Open
area-System.ComponentModel.DataAnnotations
Pri3
untriaged
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
* `RegularExpressionValidator.IsValid` [does not throw](https://github.com/dotnet/runtime/blob/20120e0d1c5f091e3596cb6dcb163ac2501220b7/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/RegularExpressionAttribute.cs#L56) `ValidationException`
* The documentation says it throws `ArgumentException` for the regex pattern even though that's not an actual argument to the public method.
* Also, the documentation doesn't explain how an argument typed as `Object?` (which is not a `String`) can be validated by a regular expression - or what happens to `null` arguments.
Contributor guide
Assessment
This issue has not been assessed yet.