ThreeMammals / Ocelot

.NET API Gateway

Home Page:https://www.nuget.org/packages/Ocelot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Routing issue when use {Literals} at last

adelvadia opened this issue · comments

I have multiple route configurations in ocelot.json

{
     "UpstreamPathTemplate": "/{Version}/List/{ListId}",
     "DownstreamPathTemplate": "/Api/{Version}/List/{ListId}",
     ...
     ...
},
{
     "UpstreamPathTemplate": "/{Version}/List/{ListId}/View/{ViewId}/Records",
     "DownstreamPathTemplate": "/Api/{Version}/List/{ListId}/View/{ViewId}/Records",
     ...
     ...
}

GET http://localhost/V1/List/100/View/256/Records

Above GET request matches first route instead of second one.

I can resolve this issue by specifying high priority to second one. Here, I expect best match instead of first match. Is there any solution to do so?

Specifications

  • Version: 23.2.2
  • Platform: Winodws 0x64
  • Subsystem: N.A