-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Consider shipping ObjectGraphDataAnnotationsValidator / ValidateComplexTypeAttribute #28640
Comments
Thanks for contacting us. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for contacting us. We're moving this issue to the |
Could the |
Could you tell us if this is planned for a specific preview? Or if it will be soon? |
@pranavkm Hello. Could you tell us if this is planned for a specific preview? Or if it will be soon? |
@danroth27 Hello. Could you tell us if this is planned for a specific preview? Or if it will be soon? What is the current status? |
@TanayParikh Hello. I am trying to get an answer. Do you know if this issue is planned for a specific preview? Or if it will be soon? What is the current status? Is it moved to .NET 8? I know that for now, it is included in the planning of .NET 7. |
That's all the information I have. We only have the RCs remaining before .NET 7 GAs. Unclear if this'll make it in the RCs or not. We'll update this issue when that decision is made. |
Thank you for your quick answer @TanayParikh |
I'll like to add a +1 that I'd really like to see this get released. |
No update on this issue, can this issue be included in .NET9 Planning and resolved with the release. |
Well, one has to look for alternatives at this point. Rolling out a custom validator is extra work |
@diptim01 Where do you see the extra work? More than assessing and including alternative dependencies? Copying the source of the last released version is a good starting point and works well out of the box. It's only two classes you need. The references and my xdoc for your convenience: /// <summary>
/// A <see cref="ValidationAttribute"/> that indicates that the property is a complex or collection type that further needs to be validated.
/// <para>
/// By default <see cref="Validator"/> does not recurse in to complex property types during validation.
/// When used in conjunction with <see cref="ObjectGraphDataAnnotationsValidator"/>, this property allows the validation system to validate
/// complex or collection type properties.
/// </para>
/// </summary>
/// <seealso cref="https://github.com/dotnet/aspnetcore/blob/bb0f54f95454352371968f76f4b3b450726b565a/src/Components/Blazor/Validation/src/ValidateComplexTypeAttribute.cs"/>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class ValidateComplexTypeAttribute : ValidationAttribute
{… /// <remarks>Based on aspnetcore 3.2 ObjectGraphDataAnnotationsValidator</remarks>
/// <seealso cref="https://github.com/dotnet/aspnetcore/issues/28640"/>
/// <seealso cref="https://www.nuget.org/packages/Microsoft.AspNetCore.Components.DataAnnotations.Validation"/>
/// <seealso cref="https://github.com/dotnet/aspnetcore/blob/bb0f54f95454352371968f76f4b3b450726b565a/src/Components/Blazor/Validation/src/ObjectGraphDataAnnotationsValidator.cs"/>
public sealed class ObjectGraphDataAnnotationsValidator : ComponentBase, IDisposable
{… |
Thanks for contacting us. We're moving this issue to the |
Classic. |
Please do it as soon as possible. |
I think the DataAnnotationValidator for Blazor Webassembly is integrated with ObjectGraphDataAnnotationsValidator. |
This seriously needs to be migrated into the Core FX for Blazor. Just looking at the download count of the pre-release packages on NuGet.org it is absolutely clear that enough people are using it and need it. |
The source code file no longer exists in aspnetcore. The nuget package last version was 3.2, indicating aspnet core version 3.2. The commit (linked from the nuget package desc) is four years ago. I tried to locate the removal commit (which may include reasoning), but after the file move to webassembly namespace I couldn't follow it anymore. I'm sure there must have been discussion on it here too, but it's not obvious from all the "me too" and "need" and "when" comment noise. |
If it's going to be released, please make it compatible with netstandard 2.0. |
"pranavkm commented on Dec 14, 2020" Here we are, 4 years later, still with the need for nested validations and yet.. input validations doesnt seem to be important to the aspnetcore team? Also love that the documentation shows to use [ValidateComplexType] and yet, where the F is it? Not in the nuget package. Or is that documentation only for the aspnetcore team? And not for us? |
Even if the source code for it can't be located in the repo history, the source code is easily attainable and can and should be added back in or at least some sort of movement on this should be done because the guidance on the documentation shows that this package should be used for validating object graphs, and the built in one is not up to the task. Couldn't the team just add this source back in or at least consider updating the guidance if this is going to be abandoned? Four years is a long time to leave developers using something marked as "experimental". |
it's still there, on the tagged version rather than main branch IIRC see my earlier comment for references #28640 (comment) |
The fix, ridiculously simple and yet to hard to be implemented? I would love to hear the reasons this isnt implemented yet since we all know how important it is to validate user input. And so to support nesting does not seem trivial to me. https://gist.github.com/bcheung4589/be0f762c7eeaab3655b4eb9041be4f0b#file-pfxvalidationmessage-cs-L49
|
Hello, is there news on this matter? |
I found the latest source code of ObjectGraphDataAnnotationsValidator here: https://github.com/dotnet/aspnetcore/tree/5da314644ae882ff22fb43101d0c3d89a35c40e9/src/Components/WebAssembly/Validation/src If you want to replicate its functionalities, you basically need these two files: |
@mkArtakMSFT why do you keep pushing this off? |
It's not entirely clear how we would solve dotnet/runtime#31400. One alternative is to ship the experimental validation features as part of Blazor instead.
The text was updated successfully, but these errors were encountered: