Skip to content

Extending Route configuration #651

@nurhat

Description

@nurhat

New Feature

We need a way to access the custom properties defined for Routes when using Ocelot configuration merge option.

Motivation for New Feature

When having multiple ocelot configuration files and using Ocelot configuration merge option, custom configurations defined for Routes are lost in the merged ocelot.json.

Steps to Reproduce the Problem

  1. Create a ocelot.xservices.json file
{
  "Routes": [ 
    {
      "DownstreamPathTemplate": "/xservice.svc/serviceMethodA/byNumber/{number}",
      "UpstreamPathTemplate": "/gw/serviceMethodA/byNumber/{number}",
      "UpstreamHttpMethod": [
        "Get",
        "Post"
      ],
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "host",
          "Port": 80
        }
      ],
      "CustomStrategyProperty": {
        "GET": [
          "SomeCustomStrategyMethodA" 
        ],
      "POST": [ 
          "SomeCustomeStrategyMethodB"
        ]
      }
    },
  ]
}
  1. Create a ocelot.yservices.json file
  2. Use AddOcelot to merge configurations and create ocelot.json config file
  3. The merged file created at the root directory, and ocelot.json does not contain custom property (e.g. "CustomerStrategyProperty") added to any Route item.

Specifications

  • Version: 12.0.1 - 19.0.2, latest

Metadata

Metadata

Assignees

Labels

Autumn'25Autumn 2025 releaseConfigurationOcelot feature: ConfigurationacceptedBug or feature would be accepted as a PR or is being worked onfeatureA new feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions