Skip to content

Add [StringSyntax(Json)] to string parameters that accept JSON#66358

Open
KitKeen wants to merge 2 commits intodotnet:mainfrom
KitKeen:add-stringsyntax-json
Open

Add [StringSyntax(Json)] to string parameters that accept JSON#66358
KitKeen wants to merge 2 commits intodotnet:mainfrom
KitKeen:add-stringsyntax-json

Conversation

@KitKeen
Copy link
Copy Markdown

@KitKeen KitKeen commented Apr 18, 2026

Add [StringSyntax(Json)] to Blazor/Identity params accepting raw JSON.

Description

Annotates string parameters that accept JSON payloads with
[StringSyntax(StringSyntaxAttribute.Json)] so IDEs and analyzers
provide JSON syntax highlighting and validation. No runtime behavior change.

Affected APIs:

  • SignInManager.PerformPasskeyAttestationAsync(credentialJson)
  • SignInManager.PerformPasskeyAssertionAsync(credentialJson)
  • SignInManager.PasskeySignInAsync(credentialJson)
  • DefaultWebAssemblyJSRuntime.EndInvokeJS(argsJson)
  • DefaultWebAssemblyJSRuntime.BeginInvokeDotNet(argsJson)
  • DefaultWebAssemblyJSRuntime.UpdateRootComponentsCore(operationsJson)
  • ComponentHub.BeginInvokeDotNetFromJS(argsJson)
  • CircuitHost.BeginInvokeDotNetFromJS(argsJson)

Follows the existing pattern used in NavigationManager,
IInternalWebJSInProcessRuntime, and WebViewManager in this repo,
and mirrors JamesNK's previous PR #45146 that added the same
attribute to other call sites.

  • Contributor Guide and Code of Conduct read
  • Inline docs unchanged (attribute is inert at runtime)
  • No tests needed (compile-time analyzer hint only, no behavior)

Fixes #44535

Adds StringSyntaxAttribute with Json identifier to parameters in
SignInManager (credentialJson), DefaultWebAssemblyJSRuntime (argsJson,
operationsJson), ComponentHub (argsJson), and CircuitHost (argsJson).

Closes dotnet#44535
@KitKeen KitKeen requested a review from a team as a code owner April 18, 2026 09:46
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Apr 18, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Apr 18, 2026
@KitKeen
Copy link
Copy Markdown
Author

KitKeen commented Apr 18, 2026

@dotnet-policy-service agree

@KitKeen
Copy link
Copy Markdown
Author

KitKeen commented Apr 19, 2026

/azp run aspnetcore-ci

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 66358 in repo dotnet/aspnetcore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add StringSyntax formats throughout source code

3 participants