Open amorelIM opened 3 months ago
Alexis, thanks for reporting this!
This bug is probably related to
but I'm not sure
Having the next route exposed in Ocelot and being able to call the $query route on the underlying service.
{ "UpstreamPathTemplate": "/v3/Orders/$query", "DownstreamPathTemplate": "/v1/Orders/$query" }
I concur that all static routes with special characters should be functional and forwarded. However, I'm curious about the rationale for defining a static route.
Why not utilize placeholders and convert templates instead?
{
"UpstreamPathTemplate": "/v3/Orders/{query}",
"DownstreamPathTemplate": "/v1/Orders/{query}"
}
or even more short version?
{
"UpstreamPathTemplate": "/v3/{everything}",
"DownstreamPathTemplate": "/v1/{everything}"
}
Why don't you utilize placeholders?
OData query is supported via using placeholders, see examples in code & docs My old answers in discussions with the same problem.
Duplicate of #859
Thank you, it worked.
@int0x81, welcome to your assignment!
Hi,
we're using ocelot as an API gateway for a service using OData. In OData, one feature is to have a route with $query in the name. For example: /v3/Orders/$query
Here is the documentation for that specific thing : https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_PassingQueryOptionsintheRequestBody
Expected Behavior / New Feature
Having the next route exposed in Ocelot and being able to call the $query route on the underlying service.
Actual Behavior / Motivation for New Feature
A 404 is returned with those warnings in the logs:
Steps to Reproduce the Problem
See previous sections. Using the '$' character in the upstream route.
Workaround
Remove the $ character from the upstreamPathTemplate, but it won't respect the OData protocol.
Specifications