Server validation with a validator component upgrade#37113
Open
Server validation with a validator component upgrade#37113
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the “Server validation with a validator component” guidance in validation.md to introduce a .NET 10+ flow that uses a Minimal API-based validation endpoint and splits the content into versioned blocks.
Changes:
- Adds a new
>= aspnetcore-10.0section demonstrating server validation via a Minimal API and a client/server validator abstraction. - Reorganizes the existing guidance into
>=8.0/<10.0and<8.0moniker blocks. - Introduces new sample code and updated narrative around client + server validation responsibilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36051
Ondřej ... Per your suggestion in #35972, the general idea is to replace the MVC controller with a Minimal API validation, including the unified validation experience. I'm getting close (see "Problem at the moment" below).
To simplify the section, the content is versioned into >=10.0, >=8.0/<10.0, and <8.0 blocks. I think we only need to focus on the new guidance in the >=10.0 coverage at the top of the section. I haven't received any complaints (or death threats 💀😨😆) from our readers on our MVC controller-based guidance.
Problem at the moment
What's on the PR works for server-side BWA processing (
ServerFormValidator), but this approach is failing to get theValidationProblemDetailsinto the validation message store in theCustomValidatorcomponent when running client-side. It's not an artifact of prerendering. There's something else going on. I'll work with it some more on Monday.Internal previews