Burgyn / MMLib.SwaggerForOcelot

This repo contains swagger extension for ocelot.
MIT License
351 stars 93 forks source link

Using the Consul service discovery, it was found that the request path in the gateway swagger document does not have the "KeyToPath" property attached #293

Open qiangboy opened 5 months ago

qiangboy commented 5 months ago

Describe the bug As stated in the title.

Expected behavior I found that there is a line of code in the source code SwaggerForOcelotMiddleware.cs that reads "if (SwaggerServiceDiscoveryProvider. ServiceProviderType!=" Consul ")". Why is this?

To Reproduce If it is a possible attache:

  1. Original downstream swagger.json.
  2. Ocelot ReRoutes configuration.
jblascoisazac commented 2 weeks ago

Im having the same issue. When using Consul with service discovery, the lib is not updating the endpoints to match the upstream template. If I remove the condition:

if (SwaggerServiceDiscoveryProvider.ServiceProviderType != "Consul")

Everything works as expected.