DotNetAnalyzers / AspNetCoreAnalyzers

MIT License
62 stars 4 forks source link

[Feature Request] Analyser to support swagger response in xml comments #94

Open lonix1 opened 2 years ago

lonix1 commented 2 years ago

Swashbuckle currently recommends to use xml comments instead of attributes:

Before

[ProducesResponseType(200)]             // either ASP.NET Core built-in
[SwaggerResponse(200)]                  // or Swashbuckle

After

/// <response code="200">Success.</response>

Problem is the API1000 doesn't recognise the xml comments, and complains:

Action method returns undeclared status code '200'

It would be nice to have an analyser for this in this library, if possible?