Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][KOTLIN] kotlin-spring generator flag appendRequestToHandler generates broken code when used with flag delegatePattern #18555

Closed
3 of 6 tasks
hagis opened this issue May 2, 2024 · 0 comments · Fixed by #19206

Comments

@hagis
Copy link
Contributor

hagis commented May 2, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When generating Kotlin code with kotlin-spring generator using both the flags

  • appendRequestToHandler
  • delegatePattern

I get classess

  1. xxApi
  2. xxApiController
  3. xxApiDelegate
  • xxApiController seems fine. It extends xxApi.
  • xxApi has a correct function signature with ServerHttpRequest as the last argument, but it calls the delegate without the ServerHttpRequest argument.
  • xxApiDelegate does not compile, because it has a broken function signature. It has an additional nullable argument without a name, and type like this ": ?"
openapi-generator version

7.5.0

Related issues/PRs

Feature request for appendRequestToHandler: #17158
PR: #17158

Suggest a fix

Support for appendRequestToHandler was added in PR #17158, and it shows no changes for apiDelegate.mustache. This leads to believe that the delegate pattern was not addressed when adding the appendRequestToHandler feature.

pstorch added a commit to pstorch/openapi-generator that referenced this issue Jul 19, 2024
…ndler generates broken code when used with flag delegatePattern
4brunu pushed a commit that referenced this issue Jul 22, 2024
…tes broken code when used with flag delegatePattern (#19206)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant