-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Open
Labels
Description
Description
This recent Pull Request enabled inputSpec resolution from a jar: URI in maven projects (thanks a lot, by the way!).
We hoped to use this new feature in gradle projects, unfortunately gradle tries to resolve the inputSpec as a file and fails to do so when a jar: URI is provided.
openapi-generator version
Gradle plugin version 7.7.0.
Steps to reproduce
A simple project is available as attachment here:
open-api-uri-issue.zip
In order to reproduce, simply run
./gradlew openApiValidate
Expected output
./gradlew openApiValidate
> Task :openApiValidate
Validating spec jar:file:src/main/resources/petstore.jar!/petstore.yaml
Spec is valid.
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
Actual output
./gradlew openApiValidate
> Task :openApiValidate FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':openApiValidate'.
> Cannot convert URL 'jar:file:src/main/resources/petstore.jar!/petstore.yaml' to a file.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 605ms
1 actionable task: 1 executed
Related issues/PRs
Suggest a fix
A fix seems to remove the constraint in GenerateTask.kt and ValidateTask.kt:
- @get:InputFile
- @PathSensitive(PathSensitivity.RELATIVE)
+ @get:Input
val inputSpec = project.objects.property<String>()Reactions are currently unavailable