Closed mcslove808 closed 3 years ago
Hi,
thank you for your issue. Unfortunately, from this description I do not understand what is wrong. Please try to describe it more clearly. Well thank you.
Hi, I see you've just added it DownstreamScheme = route.DownstreamScheme You can update The SwaggerForOcelot version of NetCoRE3.1 on Nuget.org, which I'm using
thank you
Hi,
for you 😉 I fixed it to version 3.1.1
. Try it.
thank you
Describe the bug System.UriFormatException: Invalid URI: The URI scheme is not valid.
private string GetScheme(ServiceHostAndPort service, RouteOptions route) => (route != null && !route.DownstreamScheme.IsNullOrEmpty()) ? route.DownstreamScheme : !service.Scheme.IsNullOrEmpty() ? service.Scheme : service.DownstreamPort switch { 443 => Uri.UriSchemeHttps, 80 => Uri.UriSchemeHttp, _ => string.Empty, }; result is empty because DownstreamScheme is lost public static IEnumerable GroupByPaths(this IEnumerable routeOptions)
=> routeOptions
.GroupBy(p => new { p.SwaggerKey, p.UpstreamPathTemplate, p.DownstreamPathTemplate, p.VirtualDirectory})
.Select(p => {
RouteOptions route = p.First();
return new RouteOptions(
p.Key.SwaggerKey,
route.UpstreamPathTemplate,
route.DownstreamPathTemplate,
p.Key.VirtualDirectory,
p.Where(r => r.UpstreamHttpMethod != null).SelectMany(r => r.UpstreamHttpMethod))
{
DownstreamHttpVersion = route.DownstreamHttpVersion,
//DownstreamScheme = route.DownstreamScheme
Expected behavior A clear and concise description of what you expected to happen.
To Reproduce If it is a possible attache:
swagger.json
.