Update advanced-features.md

This commit is contained in:
Mark J Price 2022-12-24 10:40:34 +00:00
parent 066212a434
commit 6cbb6f2643

View file

@ -67,15 +67,17 @@ In ASP.NET Core 2.2 or later, there are API analyzers that reflect over controll
To use it, your project must enable the OpenAPI Analyzers: To use it, your project must enable the OpenAPI Analyzers:
1. In the `Northwind.WebApi` project file, add the element that enables the OpenAPI Analyzers, as shown highlighted in the following markup: 1. In the `Northwind.WebApi` project file, add the element that enables the OpenAPI Analyzers to a project that targets the web SDK, as shown highlighted in the following markup:
```xml ```xml
<PropertyGroup> <Project Sdk="Microsoft.NET.Sdk.Web">
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable> <PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings> <TargetFramework>net6.0</TargetFramework>
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers> <Nullable>enable</Nullable>
</PropertyGroup> <ImplicitUsings>enable</ImplicitUsings>
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
</PropertyGroup>
``` ```
2. In `CustomersController.cs`, for the `Update` action method, comment out the three `[ProducesResponseType]` attributes, as shown highlighted in the following code: 2. In `CustomersController.cs`, for the `Update` action method, comment out the three `[ProducesResponseType]` attributes, as shown highlighted in the following code: