Should SwaggerForOcelot support DownstreamPathTemplate querystring params? #236
Unanswered
clockworkmice
asked this question in
Q&A
Replies: 1 comment
-
Hi, unfortunately, currently the translating parameter is not supported. See issue #197. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Could you tell me if SwaggerForOcelot is supposed to support downstream querystring mapping? I can see it mentioned in unit tests but can't get it to work myself.
My scenarios is I have an upstream that includes a path param
/example/dogs/{id}/type
and a downstream that expects that param as a querystring/types?id={id}
.If I take the querystring out of the
DownstreamPathTemplate
the swagger mapping works (but the param isn't passed downstream so it doesn't function correctly). If I put the querystring in theDownstreamPathTemplate
the call functions but the swagger no longer maps.I have downstream route like this:
app.MapGet("/types", ([FromQuery] int id) => new { id, Name = $"Type#{id}" });
And Ocelot setup with a
DownstreamPathTemplate
set up to take a path param and put it in a querystring param like this (functions but ignored in swagger docs):If I switch the above line to
"DownstreamPathTemplate": "/types",
the swagger docs work but id isn't passed downstream and so the feature doesn't work.The downstream swagger.json contains this section:
Beta Was this translation helpful? Give feedback.
All reactions