swagger-api / swagger-api/swagger-parser
swagger-parser-v3 can throw NPE due to non-initialized instance fields.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
swagger-parser-v3 can throw NPE parsing/loading Open API spec. The NPE is caused by io.swagger.v3.parser.util#ResolverFully because the schemas and examples fields are not initialized in all cases.
Version 2.0.0-rc3.
Our local fix was to just always initialize all the private fields maps with empty HashMap.
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 io.swagger.v3.parser.util.ResolverFully and trace the parsing/loading paths that use its schemas and examples fields. Reproduce the OpenAPI parsing failure against version 2.0.0-rc3, then verify that the fields are initialized in every path and the NPE no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100