Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Gradle plugin uses string type instead of file type #17380

Open
bmuschko opened this issue Dec 12, 2023 · 0 comments · May be fixed by #18573
Open

[BUG] Gradle plugin uses string type instead of file type #17380

bmuschko opened this issue Dec 12, 2023 · 0 comments · May be fixed by #18573

Comments

@bmuschko
Copy link

Description

The field inputSpec in the task ValidateTask does not use the correct type.

https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt#L55-L57

The provided annotation for input/output checks won't work properly. @InputFile has been assigned but the type is not a file property type. Incremental build functionality and build caching work as expected. For example, if you change the contents of the assigned file provided as a string. The string doesn't change, however, the content does and therefore doesn't trigger a re-run of the task.

This issue isn't limited to the task ValidateTask. The same issue applies to other task types provided by the plugin.

openapi-generator version

OpenAPI Gradle plugin 7.1.0.

OpenAPI declaration file content or url
plugins {
    id "org.openapi.generator" version "7.1.0"
}

openApiValidate {
    inputSpec = "$rootDir/petstore-v3.0-invalid.yaml"
    recommend = true
}
Steps to reproduce

Run the task openApiValidate.

Suggest a fix

The field should use the type RegularFileProperty.

@bmuschko bmuschko changed the title [BUG] Gradle plugin uses string type instead of field type [BUG] Gradle plugin uses string type instead of file type Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant