Gradle v7.0 + OpenApi Generator Gradle plugin error about mutable type

Viewed 605

I'm currently in the process of updating a gradle project with OpenApiGenerator plugin. I updated both the gradle version (v7.0) and the OpenApiGenerator plugin version (5.1.0).

When I'm trying to build, I receive this strange message:

Some problems were found with the configuration of task ':api:openApiValidate' (type 'ValidateTask').
  - Type 'ValidateTask' property 'inputSpec' of mutable type 'org.gradle.api.provider.Property' is writable.

Here is the script:

apply plugin: 'org.openapi.generator'

description = """OpenApi API Validator"""

def openApiInput = file(tasks.getByName('processResources').outputs.files.singleFile.absolutePath + "\\openapi.yml")

openApiValidate {
    inputSpec = openApiInput.path
}

tasks.findByName('openApiValidate').inputs.files openApiInput
tasks.findByName('openApiValidate').outputs.dir project.buildDir
tasks.findByName('openApiValidate').dependsOn 'processResources'
classes.dependsOn 'openApiValidate'

tasks.findByName('openApiGenerate').enabled = false

Any idea how I can fix this problem? Thanks!

0 Answers
Related