Query to Route Transform
I've tried numerous ways to find if this subject has been broached and answered, but could not find a PR or an issue (open or closed) that would tell me so.
Is there a built-in way to do a Transform for the PathPattern or PathSet that will pull the values from the Query and place them to a route?
{
"ReverseProxy": { ...#clusters and other configs#
"Routes": {
"MyRoute": {
"Match": {
"ClusterId": "MyCluster"
"Path": "/path/to/somewhere",
"QueryParameters": [{
"Name": "SearchType",
"Mode": "Exists"
}]
},
"Transforms": [
# Not working with getting the query parameter of "SearchType" above,
# into the "PathPattern" (or "PathSet") below
# Is there a way to have this work natively?
{ "PathPattern": "/internal/{SearchType}" }
]
}
}
Is there a way to utilize native Yarp transforms to change the Path pattern and pluck the Query parameter and put it into the transformed path pattern?
Or... is the current solution to this would be a custom transform?
The PathPattern can only inject values that were matched from the request path, not the query. You'd need a custom transform to pull values from the query.
Thank you @Tratcher