【问题标题】:swagger: file path in path parameterswagger:路径参数中的文件路径
【发布时间】:2016-11-03 04:01:59
【问题描述】:

这是我的 api 要求

GET http://localhost:8080/filePath/{path}

例如:

curl http://localhost:8080/filePath/home/users/user/one.txt

这里是 yaml 配置:

parameters:
        - name: path
          in: path
          description: Todo description
          type: string
          required: true

但我收到 404 错误。如何在路径参数中使用文件路径?

【问题讨论】:

标签: rest swagger swagger-2.0


【解决方案1】:

OpenAPI 2.0 (Swagger 2.0)、3.0 和 3.1 不允许您在路径参数中使用斜杠,因此您不能这样做。对此有一个开放的功能请求:

https://github.com/OAI/OpenAPI-Specification/issues/892

【讨论】:

    猜你喜欢
    • 2015-01-25
    • 2019-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-22
    • 1970-01-01
    • 2015-04-09
    相关资源
    最近更新 更多