ruby-grape / ruby-grape/grape-swagger
Does not detect Wildcard Segments as Path Parameters
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how grape-swagger converts route segments into OpenAPI paths and parameters, using the wildcard route example in the issue. Confirm that a wildcard segment is emitted as a path parameter named without its asterisk, and verify that the generated path and parameter location match the expected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100