OpenAPITools / OpenAPITools/openapi-generator
[REQ] Option to automatically delete all files/folders in outputDir for openapi gradle plugin
Open
Nobody has claimed this yet.
Enhancement: Feature
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
For openapi-generator-gradle-plugin, could you add option to automatically delete all files and folders in outputDir before generating the code files?
The option can be called "cleanOputputDir" (boolean) or such.
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"
]
cleanOutputDir = true
}
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 in the openapi-generator-gradle-plugin module and follow the openApiGenerate configuration entry point to where outputDir is processed before generation. Add the requested cleanOutputDir option, ensuring it removes the output directory contents before files are generated, and verify the Gradle plugin behavior with an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100