[BUG] Gradle Plugin - configOptions unclear / inconsistent
See original GitHub issueBug Report Checklist
x
Couldn’t find a repo for the gradle plugin so I’m posting this here.
Description
The gradle plugin offers some configuration option. But it’s not clear what has to go where. The docs have an example:
openApiGenerate {
generatorName = "kotlin"
inputSpec = "$rootDir/specs/petstore-v3.0.yaml".toString()
outputDir = "$buildDir/generated".toString()
apiPackage = "org.openapi.example.api"
invokerPackage = "org.openapi.example.invoker"
modelPackage = "org.openapi.example.model"
modelFilesConstrainedTo = [
"Error"
]
configOptions = [
dateLibrary: "java8"
]
}
Why is dateLibrary
nested inside configOptions
or regardingly, why isn’t e.g. invokerPackage
within configOptions
, too? Both are listed in the same table [1] [2] captioned “config options”. So I’d expect all those settings to live within configOptions
or none.
openapi-generator version
4.x & 5.0.0-beta2
Suggest a fix
I didn’t take a look at the other generators. Maybe I’m just blind and it’s stated somewhere.
My first shot to fix this would be to unnest configOptions
so that above example becomes:
openApiGenerate {
generatorName = "kotlin"
inputSpec = "$rootDir/specs/petstore-v3.0.yaml".toString()
outputDir = "$buildDir/generated".toString()
apiPackage = "org.openapi.example.api"
invokerPackage = "org.openapi.example.invoker"
modelPackage = "org.openapi.example.model"
modelFilesConstrainedTo = [
"Error"
]
dateLibrary = "java8"
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Generate Java Spring API from OpenAPI 3 - Stack Overflow
The problem seems to be in modelFilesConstrainedTo — it limits the classes to Error . Comment it out and it will work (classes...
Read more >Changelog and Migration Guide - Detekt
Configuring reports in the Gradle plugin should be done at the task level instead of at the extension (or global) level. The previous...
Read more >Configuration Options - OpenAPI Generator
The READMEs for the CLI, Gradle Plugin, Maven Plugin, and SBT Plugin may have top-level or tooling specific options which appear to duplicate...
Read more >Bug listing with status UNCONFIRMED as at 2022/12/12 00 ...
Bug :128538 - "sys-apps/coreutils: /bin/hostname should be installed from coreutils not sys-apps/net-tools" status:UNCONFIRMED resolution: severity:enhancement ...
Read more >Quarkus 2.x: Decomposed platform model proposal
If an app needs to add a platform extension that's not in the quarkus-bom, ... users as the Gradle plugin could enforce extension...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not doing anything with kotlin, it’s 100% java. All I did was picking the example from the docs.
My config looks like
My point was that it’s not clear to me what goes inside
configOptions
and what not, becauseopenApiNullable
is listed at the same level as e.g.apiPackage
and not nested inside someconfigOptions
.Awesome. Thanks for your efforts. I’ll close this specific issue then.