API review changes for Blazor SSR client-side validation - #67855
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Applies API review feedback for Blazor SSR client-side validation by renaming/relocating the new APIs, flipping the DataAnnotationsValidator opt-out polarity, and adding a global opt-out via RazorComponentsServiceOptions.
Changes:
- Renames
EnableClientValidationtoDisableClientValidationonDataAnnotationsValidator(polarity flip; default remains “enabled” because the default isfalse). - Introduces global opt-out
RazorComponentsServiceOptions.DisableClientValidation, wired into the SSRDataAnnotationsClientValidationProvider. - Renames
IClientValidationAdaptertoIClientValidationRuleProvider, moves client-validation types intoMicrosoft.AspNetCore.Components.Forms, and makesClientValidationRule.Parametersnon-nullable.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Components/Web/src/PublicAPI.Unshipped.txt | Updates unshipped API surface for ClientValidationProvider namespace move. |
| src/Components/Web/src/Forms/InputBase.cs | Removes old client-validation namespace import after type moves. |
| src/Components/Web/src/Forms/EditForm.cs | Removes old client-validation namespace import after type moves. |
| src/Components/Web/src/Forms/ClientValidation/RenderedFieldRegistry.cs | Moves namespace to Microsoft.AspNetCore.Components.Forms. |
| src/Components/Web/src/Forms/ClientValidation/ClientValidationProvider.cs | Moves namespace to Microsoft.AspNetCore.Components.Forms. |
| src/Components/Web/src/Forms/ClientValidation/ClientValidationData.cs | Moves namespace to Microsoft.AspNetCore.Components.Forms. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/DefaultFormBoundParameterAnnotations.razor | Updates validator parameter name/polarity in test asset. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/ClientValidation/CustomValidator.razor | Updates adapter interface name in sample code/comments. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/ClientValidation/BasicValidation.razor | Updates validator parameter name/polarity and query binding usage. |
| src/Components/test/E2ETest/ServerRenderingTests/ClientValidation/ClientValidationTest.cs | Renames test to match new parameter/polarity and updates navigation query. |
| src/Components/Forms/src/PublicAPI.Unshipped.txt | Updates unshipped API entries for DisableClientValidation. |
| src/Components/Forms/src/Microsoft.AspNetCore.Components.Forms.WarningSuppressions.xml | Removes stale trimmer warning suppression. |
| src/Components/Forms/src/DataAnnotationsValidator.cs | Flips opt-out polarity and updates docs for client-validation emission. |
| src/Components/Endpoints/test/FormValidation/ClientValidationProviderTests.cs | Renames custom adapter test/model and adds coverage for global opt-out. |
| src/Components/Endpoints/src/PublicAPI.Unshipped.txt | Reflects interface rename and Parameters nullability change; adds new options property. |
| src/Components/Endpoints/src/Forms/IClientValidationRuleProvider.cs | Renames interface for custom rule contribution. |
| src/Components/Endpoints/src/Forms/DataAnnotationsClientValidationProvider.cs | Wires global opt-out and updates interface usage. |
| src/Components/Endpoints/src/Forms/ClientValidationRule.cs | Makes Parameters non-nullable (empty dictionary when unset). |
| src/Components/Endpoints/src/DependencyInjection/RazorComponentsServiceOptions.cs | Adds DisableClientValidation global opt-out option. |
| src/Components/Endpoints/src/DependencyInjection/RazorComponentsServiceCollectionExtensions.cs | Keeps DI wiring correct after namespace/type moves (including provider registration). |
oroztocil
enabled auto-merge (squash)
July 16, 2026 19:48
akoeplinger
approved these changes
Jul 16, 2026
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 #67800
Applies the changes requested during API review of the Blazor SSR client-side validation proposal.
DataAnnotationsValidator.EnableClientValidationtoDisableClientValidation(polarity flipped, defaultfalse)RazorComponentsServiceOptions.DisableClientValidationopt-out that is read by theClientValidationProviderand suppresses rule emission for all formsIClientValidationAdaptertoIClientValidationRuleProviderClientValidationRule.Parametersnon-nullable (empty dictionary when unset)Microsoft.AspNetCore.Components.Forms.ClientValidationinto theMicrosoft.AspNetCore.Components.Formsnamespace