Repository metrics
- Stars
- (6,291 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
[Related to #1355 ]
Hi,
Been using Nswag instead of other options as I like how it automatically pulls in XML comments without additional setup or configuration.
As part of the project that I'm using NSwag with we are creating different versions of a Web API. The original v1 endpoints are deprecated and I've added the necessary ApiVersion attribute
[ApiController]
[ApiVersion("1.0", Deprecated = true)]
[Route("api/v{version:apiVersion}/[controller]")]
public class ValuesController : ControllerBase
{...`
Using the example project from AspNetCore.Tests.Web, and reading the reponses to a few other Api Versioning issues here, I got the swagger document to display the different versions of the endpoints through the dropdown on the generated Swagger page
While working to get ApiVersioning working with NSwag I noticed some examples using Swashbuckle that would render the endpoints and method with a visual strikethrough if they were marked as deprecated. However with NSwag there is nothing shown.
You can add a Swagger Tag
[SwaggerTag("VersionedValues", Description = "Old operations")]
but it doesn't have the same effect, and the value of the ApiVersion attribute doesn't seem to be shown anywhere on the generated page.
Is there any option or code I'm missing, or is that something that could be added as an enhancement? Perhaps as a tag beside the document info at the top?
Many thanks Joey