Using the openapi-gradle plugin i setup a task to generate code for the Petstore example [YAML] (https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml). I have created the following task:
task buildKotlinClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
generatorName = "kotlin-spring"
inputSpec = "$rootDir/pet.yaml".toString()
outputDir = "$rootDir/generated-sources/".toString()
apiPackage = "sandbox.api"
modelPackage = "sandbox.model"
configOptions = [
dateLibrary: "java8",
swaggerAnnotations: "true",
interfaceOnly: "true",
]
systemProperties = [
modelDocs: "false",
generateSupportingFiles: "false",
]
}
From what I understand only the PetAPI and the objects Error and Pet should be generated. Instead the task also generates Application.kt, build.gradle.kts, pom.xml, README.m, settings.gradle and application.yaml
URL: https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml
You can set the "generateSupportingFiles" option to false. It's not specifically related to the kotlin-spring generator. See this answer
I also run over this issue. generateSupportingFiles is AFAIK specific to the maven plugin.
For the gradle plugin use this:
systemProperties = [
apis: "",
models: "",
supportingFiles: "false"
]
Thank you very much for this @kleinph
Most helpful comment
I also run over this issue.
generateSupportingFilesis AFAIK specific to the maven plugin.For the gradle plugin use this: