swagger-api / swagger-api/swagger-codegen

[JavaSpring] responseWrapper method body does not match with method signature

Open
#5,359 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When using the responseWrapper configuration, the ResponseEntity is wrapped correctly in the method signature, but the content will still return a Future.

Also the fully qualified name for DeferredResult is an old package and doesn't resolve in Spring latest version.

Swagger-codegen version

2.2.0

Command line used for generation

responseWrapper
async
jdk8

Suggest a Fix

api.mustache and apiController.mustache method body

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

Inspect api.mustache and apiController.mustache, comparing the generated responseWrapper method signature with its method body and the DeferredResult package reference. Reproduce generation with responseWrapper, async, and jdk8, then verify the generated Spring code has matching response content and a package reference that resolves in current Spring versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.