ruby-grape / ruby-grape/grape-swagger
Duplicate OperationIds
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
Although GrapeSwagger::DocMethods::OperationId.build implements a mangling algorithm to generate an operation ID from a path and method, it can lead to duplicates such as /api/v4/projects/{id} and /api/v4/projects{id} both evaluating to the same operation ID, which is invalid. Although this may be an unusual path for an API, some organisations may have them as a legacy. There should be a check for duplicates to prevent this.
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 at GrapeSwagger::DocMethods::OperationId.build and trace how paths and methods are converted into operation IDs. Check existing tests for operation ID generation, then reproduce the two paths described in the issue and define coverage for preventing duplicate IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, ruby
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100