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] openapi-generator-maven-plugin delegatePattern generates non-compilable result #20471

Open
5 of 6 tasks
chiefrocker86 opened this issue Jan 14, 2025 · 0 comments
Open
5 of 6 tasks

Comments

@chiefrocker86
Copy link

chiefrocker86 commented Jan 14, 2025

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
    yes, and I've pushed it to https://github.com/chiefrocker86/spring-boot-openapi-gen
  • Have you validated the input using an OpenAPI validator (example)?
    Yes, using https://oas-validation.com/
  • Have you tested with the latest master to confirm the issue still exists?
    yes (I guess. I've been usign openapi-generator-maven-plugin version 7.10.0)
  • Have you searched for related issues/PRs?
    yes, but the related issues are really really old or don't fit.
  • What's the actual output vs expected output?
    Non-compilabe code vs compilable code
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I'm using the openapi-generator-maven-plugin in my spring boot (3) project to generate models and apis according to my OAIs.
I want to use the delegatePattern, but the generated code won't compile.

The culprit (I guess) lies in the generated controller, which needs to implement the generated API, but doesn't properly.
In this very case the controller should be generated like (I guess)
https://github.com/chiefrocker86/spring-boot-openapi-gen/blob/feature/codegen-expected/src/main/java/org/fkeller/spring/boot/openapi/gen/rest/MessageApiController.java.expected

Of course it could be that I'm using the plugin wrongly.

openapi-generator version

7.10.0

OpenAPI declaration file content or url

https://github.com/chiefrocker86/spring-boot-openapi-gen/blob/feature/codegen-expected/src/main/resources/static/openapi.yml

Generation Details

https://github.com/chiefrocker86/spring-boot-openapi-gen/blob/feature/codegen-expected/pom.xml

Steps to reproduce

git clone https://github.com/chiefrocker86/spring-boot-openapi-gen.git && cd spring-boot-openapi-gen && git checkout feature/codegen-expected && mvn clean verify

Related issues/PRs
Suggest a fix

The generation of the ApiController, which implements the Api should generate the implementation of the methods by using the delegate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant