Skip to content

Unique Swagger Description per Version #899

Discussion options

You must be logged in to vote

📣 Follow up.

Enough people have asked about this over the years, that I've taken a hard look at how this would be implemented. A new feature is coming in 6.2 that will accommodate this type of group name.

The new configuration will look like:

services.AddApiVersioning()
        .AddApiExplorer( options =>
        {
          options.GroupNameFormat = "'v'VVV";
          options.FormatGroupName = (groupName, apiVersion) => $"{groupName}-{apiVersion}";
        });

Let's say your controller looked like:

[ApiVersion( 1.0 )]
[ApiController]
[ApiExplorerSettings( GroupName = "Example" )]
[Route( "[controller]" )]
public class ExampleController : ControllerBase
{
  [HttpGet]
  public IActionResult 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@brandonsmith86
Comment options

@commonsensesoftware
Comment options

Answer selected by commonsensesoftware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants