swagger-api / swagger-api/swagger-codegen
[Bug]:Codegen in 3.0.78 fails with JsonParseException: Unrecognized token 'openapi':
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Codegen failing with exception:
[main] ERROR io.swagger.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
This worked prior to 3.0.78
Swagger Codegen Version
3.0.78
Language / Generator
java
OpenAPI/Swagger Spec
I can not determine what is the relevant part of the api spec. It passes validation, e.g. in swagger editor
See - https://gist.github.com/195858/44676d1bf4dbc0b74183258df67c502f
Related Issues / Repos
Environment
- OS: Ubuntu/github action, MacOs
- Java Version: odk 25
- Build Tool:CLI
- Swagger Codegen CLI version: 3.0.78 (installed via brew install swagger-codegen_
Additional Context
Checklist
- I have searched the existing issues to make sure this is not a duplicate.
- I have included a minimal and reproducible spec example.
- [ x I have explained how to reproduce the issue.
- I have specified which generator/language is affected.
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 SwaggerCompatConverter and reproduce the failure using the referenced gist, Swagger Codegen CLI 3.0.78, and the reported environments. Compare this behavior with the prior release and inspect why the valid OpenAPI document is being parsed as JSON; done means the CLI accepts the document and code generation completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100