-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Expected Behavior / New Feature
It should be possible to specify the placeholders freely. You might want to transform the parameters - by using a delegating handler - before calling the downstream services.
Actual Behavior / Motivation for New Feature
Ocelot throws an exception if upstream path template doesn't contain the same placeholders as downstream path template. It's a new validation introduced in Release 23.2.0. It's a breaking change with some bad side effects.
I'm using a delegating handler to transform some upstream route parameters before calling the downstream service. eg. upstream: api/v1/service/endpoint/{upParam1}/{upParam2} -> downstream api/v1/internal-service/endpoint/{downParam}. It was working like a charm, since Release 23.2.0 it's not possible anymore.
Workaround would be to add some dummy query parameters to the upstream path, but I think it's misleading.
Besides, this code part https://github.com/AlyHKafoury/Ocelot/blob/11916b6672c6ee8330cab04e1545ed6dfeb5dcfe/src/Ocelot/Configuration/Validator/FileConfigurationFluentValidator.cs#L45-L50
is clearly out of PR scope.
Steps to Reproduce the Problem
- Create an ocelot configuration file with an upstream route that does not contain the same placeholders as the downstream route. Ocelot will throw an exception during startup.
Specifications
- Version: 23.2.0