【问题标题】:Mismatch with expected vs. actual results Dredd与预期结果与实际结果不匹配 Dredd
【发布时间】:2016-12-14 03:27:53
【问题描述】:

目前我正在运行找到 here 的 uber.yaml。我目前的实际值与预期值不匹配:

expected:
headers:
Content-Type: application/json

actual:
statusCode: 301
headers:
server: nginx
date: Tue, 13 Dec 2016 20:32:28 GMT
content-type: text/html
content-length: 178
location: https://api.uber.com/v1/history
connection: close
age: 0

有人知道如何解决这个问题吗?我已编辑 uber.yaml 以包含预期的内容类型,如下所示:

- name: Content-Type
    in: header
    type: string
    required: true
    default: application/json

【问题讨论】:

    标签: swagger dredd


    【解决方案1】:

    问题是 API 响应状态码 301 和内容类型 text/html,但您的 API 描述说它应该响应内容类型 application/json。

    【讨论】:

      猜你喜欢
      • 2020-02-20
      • 2014-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多