title: Swagger doesn't read Path parameter: @Path("folder{path:.*}")
body: <p>I have a problem getting Swagger to generate correct documentation for an API call that has an optional path parameter.</p>
  
  <p>I'm building an API that peers into a hierarchical structure, similar to a file system. I want to call the same method to get the root structure as I do to get a sub resource. E.g:
  Get the root: /folder
  Get a sub folder: /folder/path/to</p>
  
  <p>My Jax-rs method looks like this:</p>
  
  <pre><code>@GET @Path("folder{path:.*}")
  Response folderContents(@ApiParam(value = "The folder to list", required = false) @PathParam("path") String path)
  {...}
  </code></pre>
  
  <p>My method call works, but my swagger documentation is incorrect and doesn't work. Swagger-ui generates GET calls that look like this when I run it:</p>
  
  <p><a href="http://localhost:8080/storage-war/rest/filestore/folder" rel="nofollow">http://localhost:8080/storage-war/rest/filestore/folder</a>{path:.*}</p>
  
  <p>I'm looking for a way to either force Swagger to generate the correct signature or rebuild my regular expression so that my generated Swagger is correct.</p>
  
  <p>Previously I'v tried using <em>@Path("folder/{path:.</em>}")*; his generated correct Swagger documentation but didn't match my no path given case. I've also tried <em>@Path("/folder{p:/?}{path:(.</em>)}")*; This produced a working method call but incorrect Swagger docs.</p>
  
  <p>Is there a straightforward way to do what I'm looking for?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>In the end I created separate method calls for root and folders. Then I decorated the root call with  it with @ApiOperation(hidden = true). This way I have an extra method in my code but only one method show up in my Swagger docs.</p>
  
  <pre><code>@GET @Path("folder/{path:.*}")
  Response folderContents(@PathParam("path") String path)
  {...}
  
  @GET @Path("folder")
  @ApiOperation(hidden = true)
  Response rootContents()
  {...}
  </code></pre>