swagger-api / swagger-api/swagger-parser
Parsing of Model "example" is not consistent with parsing of Property "example"
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
Affects v1.0.27
Currently :
- Parsing of Model "example" rely on manual code (see here)
- Parsing of Model "example" rely jackson deserialization (see here)
Depending of the type, the parsing of example
- is fine
- is converted to String whereas for property we kept the good type (boolean, array, ...)
- is converted to String with a bug "abc" value become ""abc"" with extra double quote (for string)
PR that fix that issue is coming...
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-parser/src/main/java/io/swagger/parser/util/SwaggerDeserializer.java at the model-example section around line 832 and the property-example section around line 974 in v1.0.27. Compare how each path parses examples, then verify that model examples preserve boolean, array, and other native types and that string values do not gain extra quotes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100