public object Get(Resources request)
        {
            var result = new ResourcesResponse
            {
                SwaggerVersion = "1.1",
                BasePath       = EndpointHost.Config.UseHttpsLinks ? Request.GetParentPathUrl().ToHttps() : Request.GetParentPathUrl(),
                Apis           = new List <RestService>()
            };
            var operations        = EndpointHost.Metadata;
            var allTypes          = operations.GetAllTypes();
            var allOperationNames = operations.GetAllOperationNames();

            for (var i = 0; i < allOperationNames.Count; i++)
            {
                var operationName = allOperationNames[i];
                if (resourceFilterRegex != null && !resourceFilterRegex.IsMatch(operationName))
                {
                    continue;
                }
                var operationType = allTypes.FirstOrDefault(x => x.Name == operationName);
                if (operationType == null)
                {
                    continue;
                }
                if (operationType == typeof(Resources) || operationType == typeof(ResourceRequest))
                {
                    continue;
                }

                CreateRestPaths(result.Apis, operationType, operationName);
            }
            return(result);
        }
        public object Get(Resources request)
        {
            var basePath = HostContext.Config.WebHostUrl 
                ?? Request.GetParentPathUrl().NormalizeScheme();

            var result = new ResourcesResponse
            {
                SwaggerVersion = "1.1",
                BasePath = basePath,
                Apis = new List<RestService>(),
                ApiVersion = HostContext.Config.ApiVersion
            };
            var operations = HostContext.Metadata;
            var allTypes = operations.GetAllTypes();
            var allOperationNames = operations.GetAllOperationNames();
            foreach (var operationName in allOperationNames)
            {
                if (resourceFilterRegex != null && !resourceFilterRegex.IsMatch(operationName)) continue;
                var name = operationName;
                var operationType = allTypes.FirstOrDefault(x => x.Name == name);
                if (operationType == null) continue;
                if (operationType == typeof(Resources) || operationType == typeof(ResourceRequest))
                    continue;
                if (!operations.IsVisible(Request, Format.Json, operationName)) continue;

                CreateRestPaths(result.Apis, operationType, operationName);
            }

            result.Apis = result.Apis.OrderBy(a => a.Path).ToList();
            return result;
        }
        public object Get(Resources request)
        {
            var basePath = EndpointHost.Config.WebHostUrl;
            if (basePath == null)
            {
                basePath = EndpointHost.Config.UseHttpsLinks
                    ? Request.GetParentPathUrl().ToHttps()
                    : Request.GetParentPathUrl();
            }

            var result = new ResourcesResponse
            {
                SwaggerVersion = "1.1",
                BasePath = basePath,
                Apis = new List<RestService>()
            };
            var operations = EndpointHost.Metadata;
            var allTypes = operations.GetAllTypes();
            var allOperationNames = operations.GetAllOperationNames();
            foreach (var operationName in allOperationNames)
            {
                if (resourceFilterRegex != null && !resourceFilterRegex.IsMatch(operationName)) continue;
                var name = operationName;
                var operationType = allTypes.FirstOrDefault(x => x.Name == name);
                if (operationType == null) continue;
                if (operationType == typeof(Resources) || operationType == typeof(ResourceRequest))
                    continue;

                CreateRestPaths(result.Apis, operationType, operationName);
            }

            result.Apis = result.Apis.OrderBy(a => a.Path).ToList();
            return result;
        }
        public object Get(Resources request)
        {
            var basePath = HostContext.Config.WebHostUrl;

            if (basePath == null)
            {
                basePath = HostContext.Config.UseHttpsLinks
                    ? Request.GetParentPathUrl().ToHttps()
                    : Request.GetParentPathUrl();
            }

            var result = new ResourcesResponse
            {
                SwaggerVersion = "1.1",
                BasePath       = basePath,
                Apis           = new List <RestService>(),
                ApiVersion     = HostContext.Config.ApiVersion
            };
            var operations        = HostContext.Metadata;
            var allTypes          = operations.GetAllTypes();
            var allOperationNames = operations.GetAllOperationNames();

            foreach (var operationName in allOperationNames)
            {
                if (resourceFilterRegex != null && !resourceFilterRegex.IsMatch(operationName))
                {
                    continue;
                }
                var name          = operationName;
                var operationType = allTypes.FirstOrDefault(x => x.Name == name);
                if (operationType == null)
                {
                    continue;
                }
                if (operationType == typeof(Resources) || operationType == typeof(ResourceRequest))
                {
                    continue;
                }
                if (!operations.IsVisible(Request, Format.Json, operationName))
                {
                    continue;
                }

                CreateRestPaths(result.Apis, operationType, operationName);
            }

            result.Apis = result.Apis.OrderBy(a => a.Path).ToList();
            return(result);
        }
        public object Get(Resources request)
        {
            var result = new ResourcesResponse {
                SwaggerVersion = "1.1",
                BasePath = Request.GetApplicationUrl(),
                Apis = new List<RestService>()
            };
            var operations = EndpointHost.Metadata;
            var allTypes = operations.GetAllTypes();
            var allOperationNames = operations.GetAllOperationNames();
            for (var i = 0; i < allOperationNames.Count; i++)
            {
                var operationName = allOperationNames[i];
                if (resourceFilterRegex != null && !resourceFilterRegex.IsMatch(operationName)) continue;
                var operationType = allTypes.FirstOrDefault(x => x.Name == operationName);
                if (operationType == null) continue;
                if (operationType == typeof(Resources) || operationType == typeof(ResourceRequest))
                    continue;

                CreateRestPaths(result.Apis, operationType, operationName);
            }
            return result;
        }