diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 84903ee1128c..57798ae69a8a 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -29,6 +29,8 @@ jobs: - samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/okhttp-gson-group-parameter - samples/client/petstore/java/webclient-swagger2 + - samples/client/petstore/java/native + - samples/client/petstore/java/native-jakarta steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index 80e7a6fbbe34..34f24d891617 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -73,7 +73,14 @@ ext { swagger_annotations_version = "2.2.9" {{/swagger2AnnotationLibrary}} jackson_version = "2.17.1" + {{#useJakartaEe}} + jakarta_annotation_version = "2.1.1" + beanvalidation_version = "3.0.2" + {{/useJakartaEe}} + {{^useJakartaEe}} jakarta_annotation_version = "1.3.5" + beanvalidation_version = "2.0.2" + {{/useJakartaEe}} junit_version = "5.10.2" {{#hasFormParamsInSpec}} httpmime_version = "4.5.13" @@ -94,6 +101,9 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$beanvalidation_version" + {{/useBeanValidation}} {{#hasFormParamsInSpec}} implementation "org.apache.httpcomponents:httpmime:$httpmime_version" {{/hasFormParamsInSpec}} diff --git a/samples/client/echo_api/java/native/build.gradle b/samples/client/echo_api/java/native/build.gradle index f3fbdac474a3..9dc39c3a52b0 100644 --- a/samples/client/echo_api/java/native/build.gradle +++ b/samples/client/echo_api/java/native/build.gradle @@ -68,6 +68,7 @@ artifacts { ext { jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" + beanvalidation_version = "2.0.2" junit_version = "5.10.2" httpmime_version = "4.5.13" } diff --git a/samples/client/petstore/java/native-async/build.gradle b/samples/client/petstore/java/native-async/build.gradle index 05e4fd21c2f3..ad4e835b7708 100644 --- a/samples/client/petstore/java/native-async/build.gradle +++ b/samples/client/petstore/java/native-async/build.gradle @@ -68,6 +68,7 @@ artifacts { ext { jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" + beanvalidation_version = "2.0.2" junit_version = "5.10.2" httpmime_version = "4.5.13" } diff --git a/samples/client/petstore/java/native-jakarta/build.gradle b/samples/client/petstore/java/native-jakarta/build.gradle index a4a220cac4ff..c68fefab0602 100644 --- a/samples/client/petstore/java/native-jakarta/build.gradle +++ b/samples/client/petstore/java/native-jakarta/build.gradle @@ -67,7 +67,8 @@ artifacts { ext { jackson_version = "2.17.1" - jakarta_annotation_version = "1.3.5" + jakarta_annotation_version = "2.1.1" + beanvalidation_version = "3.0.2" junit_version = "5.10.2" httpmime_version = "4.5.13" } diff --git a/samples/client/petstore/java/native/.openapi-generator-ignore b/samples/client/petstore/java/native/.openapi-generator-ignore index 7484ee590a38..65ae62012bab 100644 --- a/samples/client/petstore/java/native/.openapi-generator-ignore +++ b/samples/client/petstore/java/native/.openapi-generator-ignore @@ -21,3 +21,4 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index 05e4fd21c2f3..ad4e835b7708 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -68,6 +68,7 @@ artifacts { ext { jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" + beanvalidation_version = "2.0.2" junit_version = "5.10.2" httpmime_version = "4.5.13" }