swagger-api / swagger-api/swagger-parser
io.swagger.models.parameters.AbstractSerializableParameter#getExample get a wrong value when type is boolean
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
"false".equalsIgnoreCase(defaultValue) should be "false".equalsIgnoreCase(example)
...
} else if (BooleanProperty.TYPE.equals(type)) {
if ("true".equalsIgnoreCase(example) || "false".equalsIgnoreCase(defaultValue)) {
return Boolean.valueOf(example);
}
}
...
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.models.parameters.AbstractSerializableParameter#getExample and inspect the boolean branch shown in the issue, focusing on whether it compares example or defaultValue. Confirm the reported incorrect result and verify that boolean examples are handled consistently; no specific test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100