From 5a82211dd5d9d5c59ae5bb3de7f79b2df2ba54bb Mon Sep 17 00:00:00 2001 From: Kieun Date: Fri, 3 Nov 2023 12:23:58 +0900 Subject: [PATCH] Keep supporting 0.16.x train to support Spring Boot 2.7.x and cherry-pick the latest features and fixes. --- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 3 ++- build.gradle.kts | 6 +++--- .../epages/restdocs/apispec/openapi2/OpenApi20Generator.kt | 1 + .../restdocs/apispec/openapi3/OpenApi3GeneratorTest.kt | 3 +-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 32f2fb0e..cc7ce395 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 8 distribution: 'temurin' - name: Cache Gradle packages uses: actions/cache@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d6f342f..4791944b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,7 @@ on: push: branches: - master + - 'maintenance/**' pull_request: types: [opened, synchronize, reopened] @@ -17,7 +18,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 8 distribution: 'temurin' - name: Cache SonarCloud packages uses: actions/cache@v3 diff --git a/build.gradle.kts b/build.gradle.kts index 328ba279..ccf960fd 100755 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -57,12 +57,12 @@ allprojects { subprojects { val jacksonVersion by extra { "2.12.2" } - val springBootVersion by extra { "3.0.2" } - val springRestDocsVersion by extra { "3.0.0" } + val springBootVersion by extra { "2.1.9.RELEASE" } + val springRestDocsVersion by extra { "2.0.4.RELEASE" } val junitVersion by extra { "5.4.2" } tasks.withType { - kotlinOptions.jvmTarget = "17" + kotlinOptions.jvmTarget = "1.8" } tasks.withType { diff --git a/restdocs-api-spec-openapi-generator/src/main/kotlin/com/epages/restdocs/apispec/openapi2/OpenApi20Generator.kt b/restdocs-api-spec-openapi-generator/src/main/kotlin/com/epages/restdocs/apispec/openapi2/OpenApi20Generator.kt index 2d0c4772..f888420d 100644 --- a/restdocs-api-spec-openapi-generator/src/main/kotlin/com/epages/restdocs/apispec/openapi2/OpenApi20Generator.kt +++ b/restdocs-api-spec-openapi-generator/src/main/kotlin/com/epages/restdocs/apispec/openapi2/OpenApi20Generator.kt @@ -327,6 +327,7 @@ object OpenApi20Generator { SecurityType.OAUTH2 -> addSecurity(OAUTH2_SECURITY_NAME, securityRequirements2ScopesList(securityRequirements)) SecurityType.BASIC -> addSecurity(BASIC_SECURITY_NAME, null) SecurityType.API_KEY -> addSecurity(API_KEY_SECURITY_NAME, null) + SecurityType.JWT_BEARER -> { /* not specified for OpenApi 2.0 */ } } } } diff --git a/restdocs-api-spec-openapi3-generator/src/test/kotlin/com/epages/restdocs/apispec/openapi3/OpenApi3GeneratorTest.kt b/restdocs-api-spec-openapi3-generator/src/test/kotlin/com/epages/restdocs/apispec/openapi3/OpenApi3GeneratorTest.kt index 6b50ec3b..97305f65 100644 --- a/restdocs-api-spec-openapi3-generator/src/test/kotlin/com/epages/restdocs/apispec/openapi3/OpenApi3GeneratorTest.kt +++ b/restdocs-api-spec-openapi3-generator/src/test/kotlin/com/epages/restdocs/apispec/openapi3/OpenApi3GeneratorTest.kt @@ -1229,8 +1229,7 @@ class OpenApi3GeneratorTest { method = HTTPMethod.PUT, headers = listOf(), pathParameters = listOf(), - queryParameters = listOf(), - formParameters = listOf(), + requestParameters = listOf(), securityRequirements = null, requestFields = listOf( FieldDescriptor(