You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the openapi-generator-gradle-plugin.
I've noticed that the default value doesn't work well with ValidateTask.
I tried the samples in this repository and the problem was reproduced.
I clone this repository and exec validateGoodSpec.
git clone git@github.com:OpenAPITools/openapi-generator.git cd openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec ./gradlew validateGoodSpec
> Task :validateGoodSpec FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':validateGoodSpec'.
> No value has been specified for this provider.
* 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 895ms
1 actionable task: 1 executed
I have explicitly assigned true or false to recommend.
Then the task was successful.
> Task :validateGoodSpec
Validating spec /****/openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec/petstore-v3.0.yaml
Spec is valid.
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
Bug Report Checklist
Description
I am using the openapi-generator-gradle-plugin.
I've noticed that the default value doesn't work well with ValidateTask.
I tried the samples in this repository and the problem was reproduced.
Although
recommend
has a default value, tasks that inherit ValidateTask will fail ifrecommend
is not assigned.https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin#openapivalidate
openapi-generator version
I have tried with 4.3.0 and 4.3.1.
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/samples/local-spec/petstore-v3.0.yaml
Command line used for generation
./gradlew validateGoodSpec
./gradlew -PopenApiGeneratorVersion=4.3.0 validateGoodSpec
./gradlew -PopenApiGeneratorVersion=4.3.1 validateGoodSpec
Steps to reproduce
I clone this repository and exec validateGoodSpec.
git clone git@github.com:OpenAPITools/openapi-generator.git
cd openapi-generator/modules/openapi-generator-gradle-plugin/samples/local-spec
./gradlew validateGoodSpec
I have explicitly assigned true or false to
recommend
.Then the task was successful.
Related issues/PRs
#4643
#5183
Suggest a fix
I think it should be set default value before
get
is called atopenapi-generator/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt
Line 72 in 5fe34fb
The text was updated successfully, but these errors were encountered: