Help: Using the codegen via gradle plugin and cli #72
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
wontfix
renovate
renovate-manager
cargo
renovate-manager
dockerfile
renovate-manager
git-submodules
renovate-manager
gomod
renovate-manager
kustomize
renovate-manager
kustomize
renovate-manager
maven
renovate-manager
maven
renovate-manager
npm
renovate-manager
pip_requirements
renovate-manager
regex
renovate-manager
renovate-config-presets
renovate-manager
woodpecker
renovate-type
bump
renovate-type
digest
renovate-type
lockFileMaintenance
renovate-type
major
renovate-type
minor
renovate-type
patch
renovate-type
pin
renovate-type
pinDigest
renovate-type
replacement
renovate-type
rollback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
kokuwaio/micronaut-openapi-codegen#72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi, I'd like some help using this codegen tool.
I wanted to use the openapi-generator-gradle-plugin with this tool but am not sure of how to configure the gradle plugin to use this as a custom generator. I've added the following in build.gradle:
And of course, getting the error:
> Can't load config class with name 'micronaut'. Can someone please help?Since I got stuck with the above, I decided to try using the openapi-generator-cli instead, using the following command:
However, I'm getting the following error:
I have double checked that io.micronaut.http and the HttpStatus.java file is available, so I can't figure out why I'm getting the NoClassDefFoundError. Does anyone have a clue?
I'm on Gradle 7.0 and Java 11.
Thanks for the help!
can you try to add this to your build file:
I didn't test it but maybe this can help
Hi @rpahli, thanks for your quick response! I just tried what you suggested and I'm not getting any errors! 🎉
However, the generated code is in the folders "generated-sources" and "generated-test-sources":
Is there any way to override the folders? I would like the generated code to be in "src/main/java/com/autodesk/test/codegen". When I tried using openapi-gen previously, I believe I used use the
sourceFolderoption to configure that, but I just tried doing so here and it didn't seem to work:I think you can use this to change the output dir:
While
outputDircontrols the main folder in which the generated code go to, what I meant is I wanted to remove the "generated-sources" and "generated-test-sources" default folders/paths. Right now, the generated code is ingenerated-sources/openapi/com/autodesk/test/codegenbut I want to merge it into the existingsrc/main/java/com/autodesk/testpackage.What I want to achieve is the following structure:
Is this possible?
Thanks.
That is not possible yet: MicronautCodegen.java
Feel free to submit a pull request.
I see, thank you for the confirmation. I'll go ahead and close this issue as my questions have been addressed.
Thanks for all the help @rpahli and @stephanschnabel!