-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 23.2: UpstreamPathTemplate doesn't contain the same placeholders in DownstreamPathTemplate #2031
Comments
@ggnaegi And, first of all, show the code of your delegating handler please. |
No, unfortunately, I can't show you the delegating handler code. I catched the problem on staging environment. |
As mentioned, there are plenty of possible use cases where you could end up with the placeholders not matching. It's quite obvious in my opinion. |
In my opinion this is not so obvious. Our project is an open source project ❗All discussions and source code should be publicly available. |
I don't want to argue about this any longer, thanks. I think we have added to much validation there, that's it. I will come back with a new PR later. |
🤯 🤣No, we will continue to search for an ideal solutions... |
🦄 👑 🌈 |
@ggnaegi |
Yes, I can provide the fake delegating handler. I could write the acceptance test too. |
@raman-m I've the same problem with the following configuration
In my case it doesn't matter what |
Now I'm testing the hotfix... I'll open a PR soon... |
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
Specifications
The text was updated successfully, but these errors were encountered: