OpenAPITools / OpenAPITools/openapi-generator
[REQ] Feature Request Description
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
I am running a SpringBoot App with Groovy. So basically all my code is Groovy and Gradle must be above 6.8.x for recent versions, so I decided to go with Gradle 7.0.2
Now I also need to run ClientSide code for another open API. For this I use the gradle plugin. Generation works good. But the generated build.gradle has some flaws. It wants to run a wrapper task, which is not recommended in gradle subrojects afaik. And I am running it as a subproject as part of my overall App. What I want to achieve is, that the generated sources will be accisble directly in my spring boot app.
Right now I am able to generate, then I need to remove the wrapper task, and also convert compile to implementation, since compile is removed from latest Gradle version already.
I achieve this by running the generator like this:
task openApiGroovy(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask, dependsOn: [':downloadApiJson']) {
generatorName = "groovy"
inputSpec = "$buildDir/generated/strava-api-definition/api.json"
outputDir = "${project.getRootDir().absolutePath}/src-api"
validateSpec = false
// workaround, generated build.gradle is not working
doLast {
new File("${project.getRootDir().absolutePath}/src-api", "build.gradle").text = '''
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'org.openapitools'
version = '3.0.0'
archivesBaseName = 'openapi-gen-groovy'
buildscript {
repositories {
maven { url "https://repo1.maven.org/maven2" }
maven { url = 'https://repo.jfrog.org/artifactory/gradle-plugins' }
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16')
}
}
repositories {
maven { url "https://repo1.maven.org/maven2" }
mavenLocal()
}
ext {
swagger_annotations_version = "1.5.22"
jackson_version = "2.9.10"
jackson_databind_version = "2.9.10.8"
}
dependencies {
implementation 'org.codehaus.groovy:groovy-all:2.5.14'
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
implementation 'io.github.http-builder-ng:http-builder-ng-core:1.0.3'
testImplementation "junit:junit:4.13"
}
'''
}
}
Describe the solution you'd like
Would be nice if I could specify a Gradle version which would then create new dependency lines based on the version.
Furthermore the wrapper task should be optionally able to turn off: in case its used as subproject.
Guess it needs some configurations: https://github.com/besessener/openapi-generator/commit/257630eefae8856cee80afe0d9b1a8a4b9e80518
Describe alternatives you've considered
nothing sorry.
Additional context
Full gradle file: https://github.com/besessener/StravaActivityMerger/blob/master/build.gradle
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated build.gradle produced by the Gradle plugin's GenerateTask, then compare it with the linked full build.gradle and referenced commit. Define how a requested Gradle version affects generated dependency configurations and how wrapper generation can be disabled for subprojects; done means the generated project works without manual edits on the target Gradle version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, spring-boot
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100