Nullable Causes a Validation Error
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
The `Nullable` causes a weird issue on the model validation when it's enabled
### Expected Behavior
The model should be valid regardless of the `Nullable` option
### Steps To Reproduce
1. Create an ASP.NET Core application
2. Add a model with some properties with `Required` attribute and some without
3. Check the model using `ModelState.IsValid`
4. If the `Nullable` is enabled in the project, which is the default behavior, the model is invalid
### Exceptions (if any)
The `ModelState.IsValid` should be `true` if there's no issue in the data annotation attributes
### .NET Version
_No response_
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.