SwaggerDocumentFilter.cs 850 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MEU.API
{
    public class SwaggerDocumentFilter : IDocumentFilter
    {
        //public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer)
        //{
        //    swaggerDoc.Host = "some-url-that-is-hosted-on-azure.azurewebsites.net";
        //    swaggerDoc.BasePath = "/api";
        //    swaggerDoc.Schemes = new List<string> { "https" };
        //}

        public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
        {
            //var sever = new OpenApiServer();
            //sever.Url = "http://27.74.255.96:8089";
            //swaggerDoc.Servers.Add(sever); 
        }
    }
}