swagger-api / swagger-api/swagger-parser

Parsing of Model "example" is not consistent with parsing of Property "example"

Open
#448 1 comment 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.