Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not detect Wildcard Segments as Path Parameters #873

Open
spaceraccoon opened this issue Oct 13, 2022 · 0 comments
Open

Does not detect Wildcard Segments as Path Parameters #873

spaceraccoon opened this issue Oct 13, 2022 · 0 comments

Comments

@spaceraccoon
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant