public void Apply(Swashbuckle.AspNetCore.Swagger.SwaggerDocument swaggerDoc, DocumentFilterContext context)
 {
     swaggerDoc.Paths = swaggerDoc.Paths
                        .ToDictionary(
         path => path.Key.Replace("v{version}", swaggerDoc.Info.Version),
         path => path.Value
         );
 }
 public void Apply(Swashbuckle.AspNetCore.Swagger.SwaggerDocument document, DocumentFilterContext context)
 {
     document.Security = new List <IDictionary <string, IEnumerable <string> > >()
     {
         new Dictionary <string, IEnumerable <string> >()
         {
             { "Bearer", new string[] { } },
             { "Basic", new string[] { } },
         }
     };
 }
示例#3
0
            public void Apply(Swashbuckle.AspNetCore.Swagger.SwaggerDocument swaggerDoc,
                              Swashbuckle.AspNetCore.SwaggerGen.DocumentFilterContext context)
            {
                swaggerDoc.Schemes = new string[] { "http", "https" };

                // Determine host:
                var host = "localhost";

                if (!String.IsNullOrWhiteSpace(System.Environment.GetEnvironmentVariable("WEBSITE_HOSTNAME")))
                {
                    host = System.Environment.GetEnvironmentVariable("WEBSITE_HOSTNAME");
                }

                swaggerDoc.Host = host;
            }
示例#4
0
        static void Main(string[] args)
        {
            var a = new Swashbuckle.AspNetCore.Swagger.SwaggerDocument();

            Console.WriteLine("Hello World!");
        }