title: C# .net core swagger trying to use Multiple API Versions, but all end-points are in all documents
body: <p>We are trying to separate our API versions into different Swagger documents. We have configured everything as described in <a href="https://github.com/domaindrivendev/Swashbuckle.AspNetCore#generate-multiple-swagger-documents" rel="nofollow noreferrer">https://github.com/domaindrivendev/Swashbuckle.AspNetCore#generate-multiple-swagger-documents</a>.</p>
  <p>So we have configured two versions like this:</p>
  <pre><code>services.AddSwaggerGen(c =&gt;
  {
      c.SwaggerDoc(&quot;v1&quot;, new OpenApiInfo { Title = &quot;My API - V1&quot;, Version = &quot;v1&quot; });
      c.SwaggerDoc(&quot;v2&quot;, new OpenApiInfo { Title = &quot;My API - V2&quot;, Version = &quot;v2&quot; });
  })
  </code></pre>
  <p>Also we have configured to see them in swagger ui. like this:</p>
  <pre><code>app.UseSwagger();
  app.UseSwaggerUI(c =&gt;
  {
      c.SwaggerEndpoint(&quot;/swagger/v1/swagger.json&quot;, &quot;My API - V1&quot;);
      c.SwaggerEndpoint(&quot;/swagger/v2/swagger.json&quot;, &quot;My API - V2&quot;);
  });
  </code></pre>
  <p>To set the end-points in the right version we use the following convention:</p>
  <pre><code>public class ApiExplorerGroupPerVersionConvention : IControllerModelConvention
  {
      public void Apply(ControllerModel controller)
      {
          // e.g. &quot;Controllers.V1&quot;:
          var controllerNamespace = controller.ControllerType.Namespace; 
          var apiVersion = controllerNamespace.Split('.').Last().ToLower();
  
          controller.ApiExplorer.GroupName = apiVersion;
      }
  }
  
  public void ConfigureServices(IServiceCollection services)
  {
      services.AddMvc(c =&gt;
          c.Conventions.Add(new ApiExplorerGroupPerVersionConvention())
      );
  }
  </code></pre>
  <p>Now we see the two documents in the UI and we can go to the json files. So that works. But the all the end-points are in both the documents. We expected that we see the v1 end-points in v1 and the v2 end-points in v2. But that is not the case. If we debug the convention then we see that it set the groupname correctly. If we don't set the group name we don't see the end-points at all.</p>
  <p>So it all seems to work, except that it is not separated. Did we miss something?</p>