Fix snippets in NSwag tutorial (#8656)
Fixes the used snippets in the NSwag tutorial (currently the imports are missing and the configure snippet is used twice).pull/8780/head
parent
a485e606d2
commit
2e19966947
|
@ -91,11 +91,11 @@ dotnet add TodoApi.csproj package NSwag.AspNetCore
|
|||
|
||||
Import the following namespaces in the `Startup` class:
|
||||
|
||||
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_ConfigureServices&highlight=8-8)]
|
||||
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_StartupConfigureImports)]
|
||||
|
||||
In the `Startup.ConfigureServices` method, register the required Swagger services:
|
||||
|
||||
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_Configure&highlight=6-10)]
|
||||
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_ConfigureServices&highlight=8)]
|
||||
|
||||
In the `Startup.Configure` method, enable the middleware for serving the generated Swagger specification and the Swagger UI v3:
|
||||
|
||||
|
|
Loading…
Reference in New Issue