swagger-api / swagger-api/swagger-codegen
Path parameters aren't propagated to operation level
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
According to this line path level parameters are propagated to operation. However, the part && operation.getParameters() != null excludes this scenario, because operation relying on path level parameters (like GET /resource/{id}) will always have parameters == null. I'd recommend removing this condition because it doesn't contribute to propagating parameters from path to operation level
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 in modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/DefaultGenerator.java around line 954, where path-level parameters are propagated to operations. Check the behavior for an operation with null parameters, such as GET /resource/{id}; done means path-level parameters appear at the operation level in generated output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100