swagger-api / swagger-api/swagger-parser
Parser fails when no default value defined
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
Hi,
I was parsing a json with 1.0.10 version and everything worked well, but when I updated to 1.0.28 because I need vendor extensions to get parsed, I get an error because of setting a default value with null. I don't have default values and client don't want to writte them. Debug says is at io.swagger.parser.util.SwaggerDeserializer.parameter(SwaggerDeserializer.java:481)
sp.setDefault(defaultValue);
Any clue?
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.parser.util.SwaggerDeserializer.java:481 and inspect how parameter parsing handles a missing default value before sp.setDefault(defaultValue). Reproduce with a JSON definition that has no default values, then verify that parsing succeeds and vendor extensions are still parsed without the null-default error.
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
- 42/100