Skip to content

Fix XML doc validation warnings#66339

Merged
mikekistler merged 2 commits intodotnet:mainfrom
mikekistler:fix/xml-doc-warnings-20260415
Apr 24, 2026
Merged

Fix XML doc validation warnings#66339
mikekistler merged 2 commits intodotnet:mainfrom
mikekistler:fix/xml-doc-warnings-20260415

Conversation

@mikekistler
Copy link
Copy Markdown
Contributor

@mikekistler mikekistler commented Apr 16, 2026

Summary

Fix the XML documentation issues called out in the AspNetApiDocs validation report by replacing broken <inheritdoc/>/cref usage with explicit, resolvable documentation.

Why these changes were needed

<inheritdoc/> did not work in these cases because the docs pipeline can only expand it when it can resolve an exact published API member to inherit from. In this set of warnings, that failed for three main reasons:

  1. Some members do not actually have an inheritable parent doc source, such as constructors and newly introduced virtual methods.
  2. Some parent members or xref targets existed in code, but were not resolvable by the Learn/ECMA2Yaml xref map used for API publishing.
  3. Some <see cref="..."> links targeted internal or otherwise non-published types, which produced xref-not-found warnings during doc generation.

Result

This PR makes the generated API docs stable by using explicit summaries/parameter docs or by rewording descriptions to avoid non-resolvable references while preserving the original intent.

This should fix all the warnings in the recent API docs generation PR dotnet/AspNetApiDocs#313.

@mikekistler mikekistler requested review from a team, BrennanConroy and halter73 as code owners April 16, 2026 14:02
Copilot AI review requested due to automatic review settings April 16, 2026 14:02
@github-actions github-actions Bot added the area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer label Apr 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates public XML documentation across Security, Routing, OpenAPI, OutputCaching, and Components to eliminate AspNetApiDocs validation warnings by replacing non-resolvable <inheritdoc/> and problematic cref references with explicit summaries/parameter/return documentation.

Changes:

  • Replaced <inheritdoc/> on various ToString() overrides with explicit <summary>/<returns> docs.
  • Replaced constructor <inheritdoc/> with explicit <param> documentation in multiple authentication event context types.
  • Reworded XML docs to avoid non-resolvable cref links while preserving meaning.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Security/Authorization/Core/src/RolesAuthorizationRequirement.cs Adds explicit ToString() XML docs to avoid <inheritdoc/> expansion issues.
src/Security/Authorization/Core/src/OperationAuthorizationRequirement.cs Adds explicit ToString() XML docs.
src/Security/Authorization/Core/src/NameAuthorizationRequirement.cs Adds explicit ToString() XML docs.
src/Security/Authorization/Core/src/DenyAnonymousAuthorizationRequirement.cs Adds explicit ToString() XML docs.
src/Security/Authorization/Core/src/ClaimsAuthorizationRequirement.cs Adds explicit ToString() XML docs.
src/Security/Authorization/Core/src/AuthorizeAttribute.cs Adds explicit ToString() XML docs.
src/Security/Authorization/Core/src/AssertionRequirement.cs Adds explicit ToString() XML docs.
src/Security/Authorization/Core/src/AllowAnonymousAttribute.cs Adds explicit ToString() XML docs.
src/Security/Authentication/OpenIdConnect/src/OpenIdConnectHandler.cs Replaces <inheritdoc/> on HandleRemoteSignOutAsync with explicit XML docs.
src/Security/Authentication/OpenIdConnect/src/Events/UserInformationReceivedContext.cs Replaces constructor <inheritdoc/> with explicit <param> docs.
src/Security/Authentication/OpenIdConnect/src/Events/TokenValidatedContext.cs Fixes summary punctuation and replaces constructor <inheritdoc/> with explicit <param> docs.
src/Security/Authentication/OpenIdConnect/src/Events/RemoteSignoutContext.cs Replaces constructor <inheritdoc/> with explicit <param> docs.
src/Security/Authentication/OpenIdConnect/src/Events/PushedAuthorizationContext.cs Replaces constructor <inheritdoc/> with explicit <param> docs and removes trailing whitespace.
src/Security/Authentication/OpenIdConnect/src/Events/AuthenticationFailedContext.cs Replaces constructor <inheritdoc/> with explicit <param> docs.
src/Security/Authentication/Negotiate/src/Events/LdapContext.cs Replaces constructor <inheritdoc/> with explicit <param> docs.
src/Security/Authentication/Negotiate/src/Events/AuthenticationFailedContext.cs Replaces constructor <inheritdoc/> with explicit <param> docs.
src/Security/Authentication/Core/src/TicketSerializer.cs Replaces <inheritdoc/> with explicit docs for serialize/deserialize and claim-writing APIs.
src/Security/Authentication/Core/src/PropertiesSerializer.cs Replaces <inheritdoc/> with explicit docs for serialize/deserialize and read/write APIs.
src/OpenApi/src/Extensions/OpenApiEndpointConventionBuilderExtensions.cs Rewords delegate parameter docs to avoid problematic generic Func<...> cref usage.
src/Middleware/OutputCaching/src/OutputCacheApplicationBuilderExtensions.cs Rewords summaries to avoid linking to non-resolvable middleware type docs.
src/Http/Routing/src/Builder/RoutingEndpointConventionBuilderExtensions.cs Rewords summary to avoid cref to metadata type in the description.
src/Http/Routing/src/Builder/EndpointRoutingApplicationBuilderExtensions.cs Rewords routing/endpoint middleware docs to avoid type cref links; uses method cref references instead.
src/Components/Web/src/WebRenderer.cs Replaces <inheritdoc/> on Dispose(bool) with explicit XML docs.
src/Components/Forms/src/FieldIdentifier.cs Replaces <inheritdoc/> with explicit docs for equality/hash code APIs.
src/Components/Forms/src/DataAnnotationsValidator.cs Replaces <inheritdoc/> with explicit docs for lifecycle and disposal methods.

Copy link
Copy Markdown
Contributor Author

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding inline rationale for each documentation-only change so the cause of the warnings is clear in the PR diff.

}

/// <inheritdoc />
/// <summary>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces inheritdoc with an explicit summary because HandleRemoteSignOutAsync is its own virtual API here, so the docs pipeline had no resolvable parent member to inherit from.

public class AllowAnonymousAttribute : Attribute, IAllowAnonymous
{
/// <inheritdoc/>
/// <summary>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explicit ToString() documentation avoids the broken inherited reference to System.Attribute.ToString, which the API publishing xref map did not resolve in this build.

public string? AuthenticationSchemes { get; set; }

/// <inheritdoc/>
/// <summary>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same rationale here: explicit docs are more reliable than inheritdoc for this override because the publishing pipeline could not resolve the inherited ToString() reference cleanly.


/// <summary>
/// Adds a <see cref="EndpointRoutingMiddleware"/> middleware to the specified <see cref="IApplicationBuilder"/>.
/// Adds routing to the specified <see cref="IApplicationBuilder"/> so that incoming requests can be matched to endpoints.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These wording changes avoid linking to internal middleware implementation types that are not published in the Learn xref map, which is what triggered the xref-not-found warnings.

/// </remarks>
/// <param name="builder">The <see cref="IEndpointConventionBuilder"/>.</param>
/// <param name="configureOperation">An <see cref="Func{T, TResult}"/> that returns a new OpenAPI annotation given a generated operation.</param>
/// <param name="configureOperation">A delegate that customizes the generated OpenAPI operation metadata for the endpoint.</param>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rephrasing preserves the API meaning while avoiding a broken external xref target that the publishing pipeline could not resolve for OpenApiOperation in this context.

}

/// <inheritdoc />
/// <summary>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change avoids a non-resolvable inherited-doc reference for the override by documenting the requirement directly.

public string Name { get; set; } = default!;

/// <inheritdoc />
/// <summary>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds explicit text for the override because there is no richer inherited doc source that the published API pipeline can successfully use here.

}

/// <inheritdoc />
/// <summary>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows the same ToString() pattern: explicit docs eliminate the inherited-doc publishing suggestion and clarify the API output.

Comment thread src/Components/Forms/src/DataAnnotationsValidator.cs Outdated
public string FieldName { get; }

/// <inheritdoc />
/// <summary>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These equality/hash members now use direct XML docs because the inherited object/member documentation path was producing doc-generation suggestions instead of stable API text.

Comment thread src/Http/Routing/src/Builder/RoutingEndpointConventionBuilderExtensions.cs Outdated
Comment thread src/Security/Authentication/Core/src/PropertiesSerializer.cs Outdated
mikekistler and others added 2 commits April 23, 2026 18:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mikekistler mikekistler force-pushed the fix/xml-doc-warnings-20260415 branch from df1d4dd to a34adf6 Compare April 23, 2026 23:55
@mikekistler mikekistler enabled auto-merge (squash) April 24, 2026 00:00
@mikekistler mikekistler merged commit 52144db into dotnet:main Apr 24, 2026
25 checks passed
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview5 milestone Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants