diff --git a/aspnetcore/fundamentals/openapi/include-metadata.md b/aspnetcore/fundamentals/openapi/include-metadata.md index bc3444647110..8634d0cbc197 100644 --- a/aspnetcore/fundamentals/openapi/include-metadata.md +++ b/aspnetcore/fundamentals/openapi/include-metadata.md @@ -465,6 +465,9 @@ When not specified by an attribute: By default, there are no compile-time checks to ensure that the response metadata specified with a [`[ProducesResponseType]` attribute](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute) is consistent with the actual behavior of the action method, which may return a different status code or response body type than specified by the metadata. To enable these checks, [enable Web API analyzers](xref:web-api/advanced/analyzers). +> [!WARNING] +> The `IncludeOpenAPIAnalyzers` property and its associated Web API analyzers are deprecated as of .NET 10 and will be removed in a future release. Setting `IncludeOpenAPIAnalyzers` to `true` emits warning `ASPDEPR007`. For more information, see [IncludeOpenAPIAnalyzers property and MVC API analyzers are deprecated](/aspnet/core/breaking-changes/10/openapi-analyzers-deprecated). + In controller-based apps, ASP.NET responds with a ProblemDetails response type when model validation fails or when the action method returns a result with a 4xx or 5xx HTTP status code. Validation errors typically use the 400 status code, so you can use the [`[ProducesResponseType]` attribute](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute) to specify the error response for an action, as shown in the following example: ```csharp diff --git a/aspnetcore/fundamentals/openapi/includes/include-metadata10.md b/aspnetcore/fundamentals/openapi/includes/include-metadata10.md index 92b43e36d3e9..7ad8bc1e6f54 100644 --- a/aspnetcore/fundamentals/openapi/includes/include-metadata10.md +++ b/aspnetcore/fundamentals/openapi/includes/include-metadata10.md @@ -412,6 +412,9 @@ When not specified by an attribute: By default, there are no compile-time checks to ensure that the response metadata specified with a [`[ProducesResponseType]` attribute](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute) is consistent with the actual behavior of the action method, which may return a different status code or response body type than specified by the metadata. To enable these checks, [enable Web API analyzers](xref:web-api/advanced/analyzers). +> [!WARNING] +> Web API analyzers are deprecated as of .NET 10 and will be removed in a future release. For more information, see [IncludeOpenAPIAnalyzers property and MVC API analyzers are deprecated](/aspnet/core/breaking-changes/10/openapi-analyzers-deprecated?view=aspnetcore-10.0). + In controller-based apps, ASP.NET responds with a ProblemDetails response type when model validation fails or when the action method returns a result with a 4xx or 5xx HTTP status code. Validation errors typically use the 400 status code, so you can use the [`[ProducesResponseType]` attribute](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute) to specify the error response for an action, as shown in the following example: ```csharp diff --git a/aspnetcore/web-api/advanced/analyzers.md b/aspnetcore/web-api/advanced/analyzers.md index 480785e8a29b..9236c6182d01 100644 --- a/aspnetcore/web-api/advanced/analyzers.md +++ b/aspnetcore/web-api/advanced/analyzers.md @@ -5,11 +5,18 @@ description: Learn about the ASP.NET Core MVC web API analyzers package. monikerRange: '>= aspnetcore-3.1' ms.author: tdykstra ms.custom: mvc -ms.date: 09/05/2019 +ms.date: 06/25/2026 uid: web-api/advanced/analyzers --- # Use web API analyzers +:::moniker range=">= aspnetcore-10.0" + +> [!WARNING] +> The `IncludeOpenAPIAnalyzers` MSBuild property and its associated MVC API analyzers are deprecated as of .NET 10 and will be removed in a future release. When `IncludeOpenAPIAnalyzers` is set to `true`, the build emits warning `ASPDEPR007`. Migrate to the pattern, which provides compile-time response-type guarantees without separate analyzers. For more information, see [IncludeOpenAPIAnalyzers property and MVC API analyzers are deprecated](/aspnet/core/breaking-changes/10/openapi-analyzers-deprecated?view=aspnetcore-10.0). + +:::moniker-end + ASP.NET Core provides an MVC analyzers package intended for use with web API projects. The analyzers work with controllers annotated with , while building on [web API conventions](xref:web-api/advanced/conventions). The analyzers package notifies you of any controller action that: diff --git a/aspnetcore/web-api/advanced/conventions.md b/aspnetcore/web-api/advanced/conventions.md index 75d705f3ce8c..3b12282f472c 100644 --- a/aspnetcore/web-api/advanced/conventions.md +++ b/aspnetcore/web-api/advanced/conventions.md @@ -5,11 +5,18 @@ description: Learn about web API conventions in ASP.NET Core. monikerRange: '>= aspnetcore-3.1' ms.author: tdykstra ms.custom: mvc -ms.date: 12/05/2019 +ms.date: 06/25/2026 uid: web-api/advanced/conventions --- # Use web API conventions +:::moniker range=">= aspnetcore-10.0" + +> [!WARNING] +> The web API analyzers used with these conventions are deprecated as of .NET 10 and will be removed in a future release. Setting `IncludeOpenAPIAnalyzers` to `true` emits warning `ASPDEPR007`. For more information, see [IncludeOpenAPIAnalyzers property and MVC API analyzers are deprecated](/aspnet/core/breaking-changes/10/openapi-analyzers-deprecated?view=aspnetcore-10.0). + +:::moniker-end + Common [API documentation](xref:tutorials/web-api-help-pages-using-swagger) can be extracted and applied to multiple actions, controllers, or all controllers within an assembly. Web API conventions are a substitute for decorating individual actions with [`[ProducesResponseType]`](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute). A convention allows you to: