0

Hopefully somebody has tried something similar and provide some guide for me. I am trying to create multiple versions of Web API. I add below attribute at my controller, so on swagger screen I can see the select definition dropdown to select v1 or v2. Method A will appear on v1, method B will show on v2.

[ApiExplorerSettings(GroupName = "v1")]
public IActionResult MethodA(Guid id)

[ApiExplorerSettings(GroupName = "v2")]
public IActionResult MethodB(Guid id)

My question, is it possible to have Method B show on both v1 and v2 ?

I am using below nuget packages on NET6.

Swashbuckle.AspNetCore
Unchase.Swashbuckle.AspNetCore.Extensions

Update : Managed to found a solution. Refer below.

https://developpaper.com/the-grouping-of-net-core-swagger-enables-the-same-action-to-be-shared-by-multiple-groups-and-loads-the-ungrouped-data-at-the-same-time/

wywy2020
  • 13
  • 4

0 Answers0