swagger: file path in path parameter

眉间皱痕 提交于 2020-01-25 20:36:08

问题


Here is my api requirement

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

For example:

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

Here is yaml config:

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

But I'm getting 404 error. How can I use file path in path parameter?


回答1:


OpenAPI 2.0 (Swagger 2.0) and OpenAPI 3.0 do not allow you to use slashes in path parameters, so you can't do that. There's an open feature request for this:

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



来源:https://stackoverflow.com/questions/40393667/swagger-file-path-in-path-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!