예제 #1
0
        public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, System.Web.Http.Description.IApiExplorer apiExplorer)
        {
            //make operations alphabetic
            var paths = swaggerDoc.paths.OrderBy(e => e.Key).ThenBy(e => e.Value).ToList();

            swaggerDoc.paths = paths.ToDictionary(e => e.Key, e => e.Value);
        }
 public ManagementApiController(
     IServiceManager serviceManager,
     System.Web.Http.Description.IApiExplorer apiExplorer
     )
 {
     this.serviceManager = serviceManager;
     this.apiExplorer    = apiExplorer;
 }
예제 #3
0
        public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, System.Web.Http.Description.IApiExplorer apiExplorer)
        {
            IList <IDictionary <string, IEnumerable <string> > > security = new List <IDictionary <string, IEnumerable <string> > >();

            security.Add(new Dictionary <string, IEnumerable <string> > {
                { Key, new string[0] }
            });

            swaggerDoc.security = security;
        }
예제 #4
0
        public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, System.Web.Http.Description.IApiExplorer apiExplorer)
        {
            var badKeys = swaggerDoc.paths.Keys.Where(t => t.StartsWith("/Base") || t.EndsWith("SaveChanges")).ToList();

            foreach (var key in badKeys)
            {
                // Remove base class methods from docs
                swaggerDoc.paths.Remove(key);
            }
        }
예제 #5
0
            public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, System.Web.Http.Description.IApiExplorer apiExplorer)
            {
                var defaultApiKey = _settingManager.GetValue("Swashbuckle.DefaultApiKey", string.Empty);

                swaggerDoc.info.description = string.Format("For this sample, you can use the `{0}` key to test the authorization filters.", defaultApiKey);
                swaggerDoc.info.contact     = new Contact
                {
                    email = "*****@*****.**",
                    name  = "VirtoCommerce",
                    url   = "http://virtocommerce.com"
                };
                swaggerDoc.info.termsOfService = "";
                swaggerDoc.info.license        = new License
                {
                    name = "Virto Commerce Open Software License 3.0",
                    url  = "http://virtocommerce.com/opensourcelicense"
                };
                var tags = _packageService.GetModules().Select(x => new Tag
                {
                    name        = x.Title,
                    description = x.Description
                }).ToList();

                tags.Add(new Tag
                {
                    name        = "VirtoCommerce platform",
                    description = "Platform functionality represent common resources and operations"
                });
                swaggerDoc.tags = tags;
            }
예제 #6
0
        public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, System.Web.Http.Description.IApiExplorer apiExplorer)
        {
            var paths = swaggerDoc.paths.OrderBy(e => e.Key).ToList();

            swaggerDoc.paths = paths.Where(entry => !entry.Key.StartsWith("/api")).ToDictionary(e => e.Key, e => e.Value);
        }