Skip to content

Unable to use systemProperties in gradle plugin #551

@FatCash

Description

@FatCash
Description

Hi, I'm struggling to configure the gradle plugin to generate only model.
I can't seem to pass any property at all in systemProperties. Is my syntax incorrect?

openApiGenerate {
    generatorName = "java"
    ....
    configOptions = [
            dateLibrary: "java8",
            useBeanValidation: true
    ]
    systemProperties = [
            modelDocs: "false"
    ]
}

gives:
Caused by: java.lang.IllegalStateException: System.getProperty(key) must not be null at org.openapitools.generator.gradle.plugin.tasks.GenerateTask.doWork(GenerateTask.kt:350)
If sent as boolean it gives:
Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String at org.openapitools.generator.gradle.plugin.tasks.GenerateTask.doWork(GenerateTask.kt:543)

How to send these flags via gradle plugin?
java -Dmodels -DmodelDocs=false -DmodelTests=false

openapi-generator version

org.openapitools:openapi-generator-gradle-plugin:3.1.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions