mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
Update advanced-features.md
This commit is contained in:
parent
066212a434
commit
6cbb6f2643
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue