swagger-api / swagger-api/swagger-parser
Operations are processed twice in SwaggerResolver
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
SwaggerResolver's resolve method is processing operations twice. The pathProcessor.processPaths(); would have already processed operations within the paths. So wondering why the following code process the operations again (removed the code and ran the tests and no test failures).
if(swagger.getPaths() != null) {
for(String pathname : swagger.getPaths().keySet()) {
Path path = swagger.getPaths().get(pathname);
if(path.getOperations() != null) {
for(Operation operation : path.getOperations()) {
operationsProcessor.processOperation(operation);
}
}
}
}
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 SwaggerResolver.resolve and inspect how pathProcessor.processPaths and operationsProcessor.processOperation handle the same operations. Verify whether the repeated loop can be removed, then run the existing test suite; done means operations are processed once and all tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100