MMLib.SwaggerForOcelot not resolving Microservice Swagger Link

Viewed 572

I am using Ocelot in my Asp.Net Core 3.1 Project to serve as API Gateway and I have two microservices hosted.

I am trying to load Swagger documentation of both microservices from Gateway URL, however when I try to load documentation from gateway, MMLib.SwaggerForOcelot tries to load documentation from base path ie:

https://example.com/swagger/docs/v1/token

But actual documentation path is:

https://example.com/token/swagger/docs/v1

I have added virtual directory settings in Ocelot.Json file as well:

"SwaggerKey": "mfa", "VirtualDirectory": "/authservice",

and here is my swaggerendpoint config in Ocelot.Json file:

"SwaggerEndPoints": [
{
  "key": "mfa",
  "TakeServersFromDownstreamService": true,
  "Config": [
    {
      "Name": "MFA API",
      "Version": "v1",
      "Url": "example.com/authservice/swagger/docs/v1"
    }
  ]
},
{
  "key": "token",
  "Config": [
    {
      "Name": "Token API",
      "Version": "v1",
      "Url": "example.com/tservice/swagger/docs/v1"
    }
  ]
}   ]

can anyone help me what am i missing in this configuration?

0 Answers
Related