You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am using a downstream swagger service that has a basePath in it. When I set it up through ocelot, i have to add the basePath into the Upstream/Downstream Path Templates in order to get the routing working. When I do that though, it messes up the swagger from SwaggerForOcelot as the route cannot be detected.
then the swagger is correctly generated from SwaggerForOcelot.
But the Ocelot reRouting fails, it thinks that I need to hit this endpoint: localhost:8999/OM/api/address/check
It appears that the base path needs to be considered when working in the SwaggerJsonTransformer when finding the reRoutes.
The tests also seem to hide this issue. For instance: CreateNewJsonWhenConfigurationContainsOnlyOneController has a base path of v2. It appears that if ocelot actually used that reRoute though, that it would not work properly as the v2 would not be matched by ocelot.
The text was updated successfully, but these errors were encountered:
Describe the bug
I am using a downstream swagger service that has a basePath in it. When I set it up through ocelot, i have to add the basePath into the Upstream/Downstream Path Templates in order to get the routing working. When I do that though, it messes up the swagger from SwaggerForOcelot as the route cannot be detected.
Example Original Swagger:
To Call this it would be
localhost:8001/api/address/check.
After adding ocelot:
Ocelot.json
Now I can hit the API at
localhost:8999/api/OM/address/check
But the problem is that the swagger generated from SwaggerForOcelot does not find those routes and is not generated.
If I remove the basePath. and change the Ocelot.json to:
then the swagger is correctly generated from SwaggerForOcelot.
But the Ocelot reRouting fails, it thinks that I need to hit this endpoint:
localhost:8999/OM/api/address/check
It appears that the base path needs to be considered when working in the SwaggerJsonTransformer when finding the reRoutes.
The tests also seem to hide this issue. For instance: CreateNewJsonWhenConfigurationContainsOnlyOneController has a base path of v2. It appears that if ocelot actually used that reRoute though, that it would not work properly as the v2 would not be matched by ocelot.
The text was updated successfully, but these errors were encountered: