【问题标题】:Is it possible to use whole raw string as parameter in swagger是否可以在 swagger 中使用整个原始字符串作为参数
【发布时间】:2018-11-09 21:28:37
【问题描述】:

有一个类似的网址 http://someservice.com/confirm?{token}

这是如何用招摇符号来描述这个端点的任何方式

如果用作查询参数,那么你得到

  /confirm:
    get:
      summary: ...
      parameters:
        - in: query
          name: token
        ...

http://someservice.com/confirm?token=value 不行

从另一面来看,不能按照以下方式使用 url 表示法:

  /confirm?{token}:
    get:
      summary: ...
      parameters:
        - in: path
          name: token
        ...

由于路径中的查询字符串是不允许的。

【问题讨论】:

    标签: swagger openapi swagger-2.0


    【解决方案1】:

    OpenAPI 2.0 和 OpenAPI 3.0 目前都不支持此功能。以下是相应的功能请求:

    Support for arbitrary query strings

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-01
      • 1970-01-01
      • 2021-01-06
      • 1970-01-01
      • 1970-01-01
      • 2012-06-05
      相关资源
      最近更新 更多