swagger-api / swagger-api/swagger-codegen
[JavaSpringBoot] Delegate Pattern - codegen generates invalid code
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Error in code generation:
The delegate class won't compile because the string in the default implementation is not escaped and terminated correctly:
if corrected manually it works:
json config file:
"delegatePattern": "true",
"library": "spring-boot"
Swagger-codegen version
error occurs since 3.0.9 - 3.0.8 works without an issue
OpenAPI Version used: 3.0.2
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
Compare the linked error.java and working.java examples, then reproduce generation with delegatePattern enabled, library set to spring-boot, and OpenAPI 3.0.2 using versions 3.0.8 and 3.0.9. Trace the Spring Boot delegate template or generator path that produces the default implementation and confirm that the generated delegate compiles without manual edits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100