【问题标题】:TypeError: Failed to execute 'fetch' on 'Window': Failed to parse URLTypeError:无法在“窗口”上执行“获取”:无法解析 URL
【发布时间】:2019-10-13 18:45:29
【问题描述】:

我正在使用 MMLib.SwaggerForOcelot 作为网关。在 .Net 核心中

我收到了这个错误。有什么想法吗?

我的上游和下游:

"SwaggerEndPoints": [
    {
      "Key": "skIndustry",
      "Config": [
        {
          "Name": "Industry API",
          "Version": "v1",
          "Url": "http://industryapi:80/swagger/v1/swagger.json"

        }
      ]
    }
]

我的重新路由:

"ReRoutes": [
    {
      "DownstreamPathTemplate": "/{everything}",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "industryapi/",
          "Port": 80
        }
      ],
      "UpstreamPathTemplate": "/Industry/{everything}",
      "UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
      "SwaggerKey": "skIndustry"
    }
]

谢谢, 克罗斯。

【问题讨论】:

  • 请发布您的 OpenAPI 定义文件 (YAML / JSON) 的内容。顶部的 API 标题下应该有一个链接 (example)。如果 OpenAPI 文件是从源代码生成的,请同时发布您的代码。
  • 您好(我是 MMLib.SwaggerForOcelot 的作者),您使用的是哪个版本?请问可以提供你的ocelot配置和下游服务原swagger.json吗?谢谢。
  • 嗨@Mino,我正在使用 MMLib.SwaggerForOcelot 1.2.0。我的问题中更新了 Json 文件。
  • @Mino 你能验证这个问题吗stackoverflow.com/questions/59772540/…

标签: .net-core swagger ocelot


【解决方案1】:

请尝试新版本1.3.1

This PR probably solve similar problem.

【讨论】:

    猜你喜欢
    • 2021-04-26
    • 2018-08-13
    • 1970-01-01
    • 1970-01-01
    • 2019-01-07
    • 1970-01-01
    • 2021-07-02
    • 1970-01-01
    • 2014-04-29
    相关资源
    最近更新 更多