Repository navigation
Closed
Labels
Description
Description
Suggestions for improvements of the Blazor form validation docs for .NET 10:
-
Document new features added in RC1
SkipValidationattribute- Support for type-level validation attributes (in addition to the already existing
IValidatableObjectsupport)
-
Document behavior of the DataAnnotationsValidator
- After RC1 the new validation infrastructure and consequently the DataAnnotationsValidator component have the same behavior with regards to validation order and short-circuiting as
System.ComponentModel.DataAnnotations.Validator - We could add a brief description of this logic so that user's are not surprised about the validation outcome when they have a combination of property-level and type-level validation rules
- After RC1 the new validation infrastructure and consequently the DataAnnotationsValidator component have the same behavior with regards to validation order and short-circuiting as
-
Remove information about
ObjectGraphDataAnnotationsValidator- The docs for complex object validation contain a mixture of information describing both the new validation implementation and the deprecated
ObjectGraphDataAnnotationsValidatorfrom the unsupoorted NuGet package - We want to remove all mentions of the old package
- Optionally, leave a short note stating that
ObjectGraphDataAnnotationsValidatorshould not be used and point the users to the improved capabilities of the standard component
- The docs for complex object validation contain a mixture of information describing both the new validation implementation and the deprecated
-
MOVED TO Server validation with a validator component upgrade #36051
Idea: Replace use of MVC controller with Minimal API in the section "Server validation with a validator component" to showcase the unified validation experienceThe API controller uses MVC-based validation which also usesDataAnnotationsattribute to specify validation rules. However, it is configured differently and might have different behavior in some cases (e.g. validation is skipped withValidateNeverattribute in MVC but withSkipValidationattribute in the unified validation code)Up for debate: Speaking of "server validation" and "client validation" might also be a bit confusing in the context of Blazor Server - maybe rephrase the section using terminology such as "data API", "backend", or "backend API"?
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/forms/validation?view=aspnetcore-10.0
Content source URL
Document ID
bcb470e1-c859-0549-b4ef-c6c9b7ef2c72
Platform Id
b4c1bad9-fc7a-21f5-2552-f0f3617f77db
Article author
Metadata
- ID: bcb470e1-c859-0549-b4ef-c6c9b7ef2c72
- PlatformId: b4c1bad9-fc7a-21f5-2552-f0f3617f77db
- Service: aspnet-core
- Sub-service: blazor
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Aug 21, 2025
🏖️🌞 Summertime!! Woot!! 🏐⛵
Stand-by! ... A green dinosaur 🦖 will be along shortly to assist.
[-]Update Blazor form validation docs for .NET 10[/-][+][RC1] Update Blazor form validation docs for .NET 10[/+]oroztocil commentedon Aug 21, 2025
@guardrex I can write a draft of the suggested changes and create a PR where you can take over. Does that work for you?
guardrex commentedon Aug 21, 2025
You can do that or post the content in an issue comment here.
It could be problematic if several PRs from several PU members and myself all step on each other for RC1, especially this early. Typically, I place one large PR with all of the preview coverage on it (one commit per new feature or feature change), and I do so close to RC1's release to not foul other work in the meantime. This avoids PRs stepping all over each other. However, you can go ahead and we'll see how it goes 🤞🍀. Pavel was successful at Pre7 with a couple of early metrics PRs, but they only touched one article each, so the merge conflict demons 😈 couldn't foul things up.
Some of this is versioned. For example,
ObjectGraphDataAnnotationsValidatorshould be versioned out, not actually removed. Server validation with a validator component changes also must be versioned because Minimal APIs didn't arrive until 6.0. If you want to leave some aspects like that to me, you can post the content changes here.oroztocil commentedon Aug 21, 2025
@guardrex Ok, thanks for giving me the context. I will add the proposed changes here as comments 🙂
guardrex commentedon Sep 4, 2025
@oroztocil ... Besides the instructions that you provided in the OP here, does what you placed in the What's New issue cover everything for this subject ...
#35994 (comment)
If so, I'll work on this soon (today/tomrrow) and ping you for review when it goes up.
oroztocil commentedon Sep 4, 2025
@guardrex If you think you have all the information you need, feel free to update the docs 🙂
We are focusing on testing and fixes in the RC2 window so did not have time yet to write the proposed docs changes.
guardrex commentedon Sep 4, 2025
I think so, but this one ...
... is going to take more time than I have right now. I think that item should be a separate issue for later, probably even after .NET 10's release because Dan and I are trying to get main doc set articles more focused on Blazor than RP/MVC, plus I'm performing full overhauls on the articles because they haven't been overhauled in several years.
I don't think that there's anything broken with the MVC controller ... it's just not the best approach any longer. I think we have a little wiggle room to wait on updating it. UPDATE: I added a NOTE to the section indicating that we'll go with Minimal APIs soon.
I think that I should add a note to it right now saying that the approach is scheduled for an upgrade to an API controller-based approach in the near future, which would at least alert readers that we plan to pitch a new, better approach for it without actually having to do that work immediately.UPDATE: Opened #36051 to work on this item separately.
oroztocil commentedon Sep 4, 2025
@guardrex Definitely, we can do the controller example change later (or not at all). I just wanted to propose it as idea. Thanks for opening the separate issue 🙂