OpenAPITools / OpenAPITools/openapi-generator

[BUG] Cannot set systemProperties for the Gradle plugin

Open
#10,181 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
Description

Hello, I am trying to set the systemProperties field of the Gradle plugin's openApiGenerate task and am getting the following error:

Caused by: groovy.lang.MissingPropertyException: Could not set unknown property 'systemProperties' for extension 'openApiGenerate' of type org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorGenerateExtension.
	at org.gradle.internal.metaobject.AbstractDynamicObject.setMissingProperty(AbstractDynamicObject.java:118)

I need this to set generateSupportingFiles to false. It seems that the maven plugin has this as a property but for Gradle it has to be done through a system property (is it better perhaps to ask for that as a feature instead?).

This is my Gradle task definition:

openApiGenerate {
    generatorName = "spring"
    inputSpec = "$rootDir/api/api-v1.0.yml".toString()
    outputDir = "$projectDir".toString()
    apiPackage = "com.example"
    modelPackage = "com.example"
    configOptions = [
            interfaceOnly: "true",
            openApiNullable: "false",
    ]
    systemProperties = [
            generateSupportingFiles: "false"
    ]
}

Thank you!

openapi-generator version

5.2.1
(could be a regression of https://github.com/OpenAPITools/openapi-generator/issues/551)

Steps to reproduce

Add my task configuration to a blank Gradle 7.1.1 project.

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/551

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the configuration in a blank Gradle 7.1.1 project using the shown openApiGenerate task and confirm the MissingPropertyException. Read the Gradle plugin extension and compare its supported properties with the related issue #551; done means the requested systemProperties behavior or an explicitly documented alternative is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.