Cannot implicitly convert type
'System.Collections.Generic.Dictionary<string, Microsoft.OpenApi.Models.OpenApiPathItem>' to 'Microsoft.OpenApi.Models.OpenApiPaths'
An explicit conversion exists (are you missing a cast?)
public class ReplaceVersionWithExactValueInPath : IDocumentFilter
{
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
swaggerDoc.Paths = swaggerDoc.Paths
.ToDictionary(
path => path.Key.Replace("v{version}", swaggerDoc.Info.Version),
path => path.Value
);
}
}