markjprice / cs10dotnet6

Repository for the Packt Publishing book titled "C# 10 and .NET 6 - Modern Cross-Platform Development" by Mark J. Price
853 stars 373 forks source link

Chapter 16 section "Implementing open api analyzers and conventions" #111

Closed tarurar closed 1 year ago

tarurar commented 1 year ago

The mentioned steps are not enough. Open API analyzers work only for project which use sdk = "Microsoft.NET.Sdk.Web" and are not triggered for others.

markjprice commented 1 year ago

Thank you for raising this issue, Andrei.

Since this whole chapter is about Web API projects that have to target the Web SDK, and this section is about how to decorate controller classes with attributes that would also only work in a project that targets the Web SDK, a target framework of Microsoft.NET.Sdk.Web is already implied.

But in the eighth edition I will make it more explicit as you suggest. I've added an entry to the improvements sections for the sixth edition: https://github.com/markjprice/cs10dotnet6/blob/main/docs/errata/improvements.md#page-709---implementing-open-api-analyzers-and-conventions

I've also updated the relevant section for the seventh edition: https://github.com/markjprice/cs11dotnet7/blob/main/docs/bonus/advanced-features.md#implementing-open-api-analyzers-and-conventions