title: What is AddEndpointsApiExplorer in ASP.NET Core 6
body: <p>I'm upgrading an ASP.NET Core API project from v5 to v6.</p>
  <p>Service config in <a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-5.0&amp;tabs=netcore-cli#add-and-configure-swagger-middleware-1" rel="noreferrer">v5</a>:</p>
  <pre class="lang-cs prettyprint-override"><code>services.AddSwaggerGen();
  </code></pre>
  <p>Service config in <a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-6.0&amp;tabs=netcore-cli#add-and-configure-swagger-middleware" rel="noreferrer">v6</a>:</p>
  <pre class="lang-cs prettyprint-override"><code>builder.Services.AddEndpointsApiExplorer();    // what is this?
  builder.Services.AddSwaggerGen();
  </code></pre>
  <p>What is <code>AddEndpointsApiExplorer</code>? Everything works as expected whether I add it or not.</p>
  <p>I use the &quot;ASP.NET API Versioning&quot; <a href="https://github.com/dotnet/aspnet-api-versioning" rel="noreferrer">library</a>. Are they related? If so, must I use both, just the library, or is the library unnecessary now?</p>