swagger-api / swagger-api/swagger-parser
Enum string value "YES" becomes "true"
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
I have encountered an exception which looks suspicious while utilizing the String enum property with the value YES. The result is that YES becomes true somehow?
My guess is that is has to do with the conversion from YAML to JSON.
Reproduce:
- Unzip the attached file
- Copy the new-issue.yaml to the following location: swagger-parser\modules\swagger-parser-v3\src\test\resources
- Replace OpenAPIV3ParserTest.java in the following location: swagger-parser\modules\swagger-parser-v3\src\test\java\io\swagger\v3\parser\test
- Execute the test case testNewIssue(), the result is failure.
A work around could be to replace YES with some other string else or just add " to make it a string
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 with OpenAPIV3ParserTest.java and the supplied new-issue.yaml in swagger-parser-v3/src/test/resources, then run testNewIssue() to reproduce the failure. Trace the YAML-to-JSON conversion involved in parsing the String enum. Done means the value YES remains a string and the test passes.
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
- 45/100