小编Ens*_*glu的帖子

无法合并 Ocelot 配置文件

根据文档,我尝试合并我的配置文件,以便它们更具可读性。然而,生成的 ocelot.json 文件并不像预期的那样。我的文件夹结构如下:

文件夹结构

下面是这个的文本表示:

.
??? Ocelot route configs
    ??? ocelot.pokemon.json
    ??? ocelot.tweet.json
    ??? ocelot.weather.json
Run Code Online (Sandbox Code Playgroud)

ocelot.pokemon.json 文件如下所示(其他类似):

{
  "Routes": [
    {
      "DownstreamPathTemplate": "/api/v2/pokemon",
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "pokeapi.co",
          "Port": 443
        }
      ],
      "UpstreamPathTemplate": "/api/pokemon",
      "UpstreamHttpMethod": [ "GET" ],
      "AuthenticationOptions": {
        "AuthenticationProviderKey": "MyTestKey",
        "AllowedScopes": []
      }
    },
    {
      "DownstreamPathTemplate": "/api/v2/pokemon/ditto",
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "pokeapi.co",
          "Port": 443
        }
      ],
      "UpstreamPathTemplate": "/api/pokemon/ditto",
      "UpstreamHttpMethod": [ "GET" ]
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

生成的 ocelot.json 文件如下所示:

{
  "Routes": [ …
Run Code Online (Sandbox Code Playgroud)

ocelot

7
推荐指数
1
解决办法
172
查看次数

标签 统计

ocelot ×1