0

I can't find this method AddVersionedApiExplorer to configure swagger in the dotnet core 6 version of Asp.Versioning.Mvc.ApiExplorer. What is the new way to configure swagger with this versioning library?

Tiny Wang
  • 10,423
  • 1
  • 11
  • 29
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30
  • Can [this answer](https://stackoverflow.com/questions/72541447/swaggergeneratorexception-conflicting-method-path-combination-post-api-vversi/72554277#72554277) help you? The `builder.Services.AddApiVersioning` is from `Microsoft.AspNetCore.Mvc.Versioning` – Tiny Wang Sep 05 '22 at 01:57
  • I am looking at this blog post https://moethorstensen.no/versioning-apis/ where they say what about swagger configuration and give an example of configuration for the GroupNameFormatand and SubstituteApiVersionInUrl – OutOFTouch Sep 05 '22 at 19:24

1 Answers1

1

Seems that the method has been removed without any indication as to why.

Found this comment in github which seems to be the new way of handling it.

        services
            .AddApiVersioning()
            .AddApiExplorer();

https://github.com/OData/AspNetCoreOData/issues/480#issuecomment-1094107292

  • Ok, I looked at that post and I am still left with wondering how to use .AddApiExplorer() to configure swagger, assuming that is the method to use now – OutOFTouch Sep 07 '22 at 14:50