1

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?

gangadhars
  • 2,584
  • 7
  • 41
  • 68
  • Possible duplicate of [Swagger: wildcard path parameters](https://stackoverflow.com/questions/42335178/swagger-wildcard-path-parameters) – Helen May 22 '19 at 20:30

1 Answers1

2

OpenAPI 2.0 (Swagger 2.0), 3.0, and 3.1 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

Helen
  • 87,344
  • 17
  • 243
  • 314
Ron
  • 14,160
  • 3
  • 52
  • 39