Fix XML doc validation warnings#66339
Conversation
There was a problem hiding this comment.
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 variousToString()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
creflinks 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. |
mikekistler
left a comment
There was a problem hiding this comment.
Adding inline rationale for each documentation-only change so the cause of the warnings is clear in the PR diff.
| } | ||
|
|
||
| /// <inheritdoc /> | ||
| /// <summary> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
This follows the same ToString() pattern: explicit docs eliminate the inherited-doc publishing suggestion and clarify the API output.
| public string FieldName { get; } | ||
|
|
||
| /// <inheritdoc /> | ||
| /// <summary> |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
df1d4dd to
a34adf6
Compare
Summary
Fix the XML documentation issues called out in the AspNetApiDocs validation report by replacing broken
<inheritdoc/>/crefusage 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:<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.