Skip to content

Does not detect Wildcard Segments as Path Parameters #873

Open
@spaceraccoon

Description

@spaceraccoon

Ruby on Rails supports wildcard segments, such as:

get 'books/*section/:title'

would match books/some/section/last-words-a-memoir with params[:section] equals 'some/section', and params[:title] equals 'last-words-a-memoir'.

However, grape-swagger does not recognise these wildcard segments as path parameters. For example:

get 'books/*section/:title' 

would generate:

"paths": {
  "/api/v2/books/*section/{title}": {
    "get": {
    ...
      "parameters": [
         {
           "in": "query", "name": "*section"
           ...
  }
}

instead of the expected:

"paths": {
  "/api/v2/books/{section}/{title}": {
    "get": {
    ...
      "parameters": [
         {
           "in": "path", "name": "section"
           ...
  }
}

grape-swagger should also recognise wildcard segments as path parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions