gradle openapi generator doesn't work for selective generation

Viewed 18

When we run gradle openapi generator tasks, part of the generated output has an infrastructure folder with all of the shared/common files required for the client to build.

When I start specifying the apis and models that I want generated, then this infrastructure folder is no longer created, so nothing builds!!

What am I doing wrong?

task buildMyClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
    generatorName = "kotlin"
    inputSpec = "$rootDir/openapi/specs/myservice.yaml".toString()
    outputDir = "$buildDir/generated".toString()
    apiPackage = "com.mycompany.myservice"
    packageName = "com.mycompany.myservice"
    modelPackage = "com.mycompany.myservice.model"
    globalProperties = [
        apis: "MyController",
        models: "MyApiRequest,MyApiResponse,EmbeddedApiResponse"]
    configOptions = [
            "enumPropertyNaming": "UPPERCASE"
    ]
}

Here are the docs on the gradle plugin: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/README.adoc

Here are the docs on global properties: https://openapi-generator.tech/docs/globals/

Seems that I might have to specify all supporting files? How do I do that? There isn't some way to use the default?

0 Answers
Related