JVM overloads option? #2153
Replies: 5 comments 2 replies
-
I tried setting build.gradle.ktsmicronaut {
openapi {
client(file("src/main/resources/helpcenter.yaml")) {
apiPackageName.set("lol.pbu.z4j.ticket.client")
modelPackageName.set("lol.pbu.z4j.ticket.model")
useReactive.set(false)
useAuth.set(false)
lombok.set(true)
}
}
... build errorFAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':helpcenter:compileJava'.
> Compilation failed; see the compiler output below.
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\ListArticlesSortByParameter.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\ListArticlesSortOrderParameter.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\ListCategoriesSortByParameter.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\ListPostsFilterByParameter.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\ListPostsSortByParameter.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\UnifiedSearchResultType.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\SectionPutRequestSectionSorting.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\TopicObjectManageableBy.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
C:\Users\jonat\src\git.pbu.lol\z4j\helpcenter\build\generated\openapi\generateClientOpenApiModels\src\main\java\lol\pbu\z4j\ticket\model\ListUserSubscriptionsByUserIdTypeParameter.java:39: error: cannot find symbol
@Getter(onMethod = @__(@JsonValue))
^
symbol: class __
9 errors
* Try:
> Check your code and dependencies to fix the compilation error(s)
> Run with --scan to get full insights.
BUILD FAILED in 50s
32 actionable tasks: 32 executed
|
Beta Was this translation helpful? Give feedback.
-
@Jonathan-Zollinger about lombok: you didn't add lombok dependencies to your project. Need to add these lines: annotationProcessor("org.projectlombok:lombok")
compileOnly("org.projectlombok:lombok") I fixed your sample project here: PeanutButter-Unicorn/z4j#3 Regarding @jvmoverloads? To be honest, I don't understand what you're proposing. There is a possibility to connect lombok and it works. So what is your proposal? |
Beta Was this translation helpful? Give feedback.
-
Or, maybe you suggest to add ability to generate |
Beta Was this translation helpful? Give feedback.
-
@Jonathan-Zollinger done: #2173 |
Beta Was this translation helpful? Give feedback.
-
Thanks a ton! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In kotlin you can annotate a data class with @jvmoverloads so that you don't have to write multiple constructors if some of a class's fields have default values. This is really handy when some api's have a bunch of nullable types. I think you can do the same thing with java if you use lombok's @DaTa annotation.
It would be really nice to have this supported somehow when generating a client
Beta Was this translation helpful? Give feedback.
All reactions