Skip to content

Upstream and Downstream with different paths and body fields #245

Answered by Burgyn
LucasRufo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @LucasRufo,

different parameter names are unfortunately a problem. Because we cannot match the gateway path to the paths from the documentation.

You can try use Different parameter names, but it is unverified for this use case. It was designed for aggregation.

Extra fields. You can try to do a custom post-process on the documentation before it is displayed:

public string AlterUpstreamSwaggerJson(HttpContext context, string swaggerJson)
{
  var swagger = JObject.Parse(swaggerJson);
  // ... alter upstream json
  return swagger.ToString(Formatting.Indented);
}

app.UseSwaggerForOcelotUI(opt => {
  opt.ReConfigureUpstreamSwaggerJson = AlterUpstreamSwaggerJson;
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LucasRufo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants