MiniValidation icon indicating copy to clipboard operation
MiniValidation copied to clipboard

A minimalist validation library for .NET built atop the existing features in `System.ComponentModel.DataAnnotations` namespace

Results 25 MiniValidation issues
Sort by recently updated
recently updated
newest added

Is there any way to convert error keys from their C# property names to their JSON property names, as in MVC model validation? https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-8.0#use-json-property-names-in-validation-errors

enhancement

Hi. I'm moving my model from class with properties to read-only struct, and I also want to save the same validations as I have previously. Unfortunately, the Validator doesn't iterate...

enhancement

If you have dynamic payloads like JsonPatch / Delta or content that may be a JToken or other Json Type MiniValidator throws quickly. Can we add some type guards or...

bug

It's impossible to know if a given property getter will throw during validation due to the state of the object, so just swallow any exception from getting the value. Fixes...

This project talks about MinimalApi.Extensions but what about all existing projects that are not using minimal apis? Are there any plans to support this via ObjectModelValidator, IBindingMetadataProvider, IModelValidatorProvider, ValidationVisitor implementations?

Look at optimizing the loops in the validation code paths. Inspired by @elfocrash https://www.youtube.com/watch?v=cwBrWn4m9y8

Currently 'TryValidate' method returns `IDictionary`. If we look at the implementation of the 'TryValidate' method, it first creates `Dictionary` then it maps it to `Dictionary` using the `ToArray` method. But...

The validator has to allocate strings for each field it validates, including adding a level prefix as it descends the object graph, even if there don't end up being any...

performance

When MiniValidator is performing validation on an `IValidatableObject`, it seems like it partitions the validation into two halves. The property based validation is done first, and then the `IValidatableObject` `Validate`...

Supporting polymorphism requires the entire object graph of the object being validated be walked every time as any member of a type maybe a descendent type at runtime for that...

enhancement