Skip to content

Release 23.2: UpstreamPathTemplate doesn't contain the same placeholders in DownstreamPathTemplate #2031

@ggnaegi

Description

@ggnaegi

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

  1. 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

Metadata

Metadata

Assignees

Labels

ConfigurationOcelot feature: ConfigurationFeb'24February 2024 releasebugIdentified as a potential bughighHigh priorityhotfixGitflow: Hotfix issue, PR related to hotfix branchmergedIssue has been merged to dev and is waiting for the next releaseproposalProposal for a new functionality in Ocelot

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions