简体   繁体   English

swagger:path参数中的文件路径

[英]swagger: file path in path parameter

Here is my api requirement 这是我的API要求

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

For example: 例如:

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

Here is yaml config: 这是yaml配置:

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

But I'm getting 404 error. 但我收到404错误。 How can I use file path in path parameter? 如何在path参数中使用文件路径?

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. OpenAPI 2.0(Swagger 2.0)和OpenAPI 3.0不允许在路径参数中使用斜杠,因此您不能这样做。 There's an open feature request for this: 对此有一个开放功能要求:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM