DamianEdwards / DamianEdwards/MiniValidation
Support required modifier
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 390
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
It would be nice if the required modifier could be considered a way of making properties required. You could think of the following:
class Model
{
public required string MakeRequired { get; init; } // When analyzing this property, add a default instance of a RequiredAttribute to the list of validation attributes/
public required int ValueType { get; init; } // Ignore, adding a required attribute will not change a thing.
public required string? NullableReference { get; init; } // Ingore, it must be set, but null is considered valid option.
[Any]
public required int[] SomeObject { get; init; } // Ignore, AnyAttribute inherits from RequiredAttribute and should prevail.
}
What do you think?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests, but provides C# property examples for the proposed behavior. Start by tracing how MiniValidation analyzes property metadata and validation attributes, then compare non-nullable reference types, value types, nullable references, and existing RequiredAttribute-derived attributes. Done means the required modifier is handled according to all four examples with coverage for each case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100