Skip to content

Handle responseContainer without response in ApiResponse migration#75

Merged
timtebeek merged 1 commit intomainfrom
tim/issue-74
May 1, 2026
Merged

Handle responseContainer without response in ApiResponse migration#75
timtebeek merged 1 commit intomainfrom
tim/issue-74

Conversation

@timtebeek
Copy link
Copy Markdown
Member

Summary

  • Fixes ConvertApiResponseToContent throws when @ApiResponse has responseContainer but no response #74: ConvertApiResponseToContent crashed with IllegalArgumentException: This template requires more parameters when @ApiResponse had responseContainer (e.g. "List") but no response attribute.
  • When contentClass is null, drop the orphan responseContainer (no v3 equivalent) and emit the annotation without a content schema.
  • Adds a regression test covering responseContainer = "List" without response.

Test plan

  • ./gradlew test

…oContent`

Previously crashed with `IllegalArgumentException: This template requires more parameters` because the template included a placeholder for the missing response class. Now drops the orphan `responseContainer` (no v3 equivalent) and leaves the rest of the annotation intact.

Fixes #74
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite May 1, 2026
@timtebeek timtebeek requested a review from nmck257 May 1, 2026 07:37
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite May 1, 2026
@timtebeek timtebeek merged commit dfa01d9 into main May 1, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite May 1, 2026
@timtebeek timtebeek deleted the tim/issue-74 branch May 1, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ConvertApiResponseToContent throws when @ApiResponse has responseContainer but no response

2 participants