hasancali_NetCoreAPI/Web/OpenAPI/RemoveVersionFromParameter.cs
using System.Linq;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace Web.OpenAPI
{
    public class RemoveVersionFromParameter : IOperationFilter
    {
        public void Apply(
            OpenApiOperation operation,
            OperationFilterContext context)
        {
            var versionParameter = operation.Parameters.SingleOrDefault(p => p.Name == "version");
            if (versionParameter != null) 
                operation.Parameters.Remove(versionParameter);
        }
    }
}