title: Migrate code 2.0 to 3.1 core code then swagger api versioning not working
body: <blockquote>
  <p>Cannot implicitly convert type <br>
  'System.Collections.Generic.Dictionary&lt;string,
  Microsoft.OpenApi.Models.OpenApiPathItem&gt;' to
  'Microsoft.OpenApi.Models.OpenApiPaths'<br>
  An explicit conversion exists (are you missing a cast?)</p>
  </blockquote>
  <pre><code>public class ReplaceVersionWithExactValueInPath : IDocumentFilter
  {
      public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
      {
          swaggerDoc.Paths = swaggerDoc.Paths
              .ToDictionary(
                  path =&gt; path.Key.Replace(&quot;v{version}&quot;, swaggerDoc.Info.Version),
                  path =&gt; path.Value
              );
      }
  }
  </code></pre>