From 37c9343792dc8f14abd02be8801bfbf55fea7201 Mon Sep 17 00:00:00 2001 From: Ivan Ponomarev Date: Thu, 16 Nov 2023 21:46:35 +0000 Subject: [PATCH] use jakarta packages (#264) --- README.md | 2 +- pom.xml | 4 ++-- src/main/java/ru/curs/hurdygurdy/JavaAPIExtractor.java | 2 +- src/main/java/ru/curs/hurdygurdy/KotlinAPIExtractor.kt | 2 +- src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt | 4 ++-- .../hurdygurdy/CodegenTest.dictionarySupport.approved.txt | 2 +- .../CodegenTest.generateCommonParameters.approved.txt | 2 +- .../hurdygurdy/CodegenTest.generateMultipart.approved.txt | 2 +- .../curs/hurdygurdy/CodegenTest.generateSample1.approved.txt | 2 +- .../curs/hurdygurdy/CodegenTest.generateSample2.approved.txt | 4 ++-- .../ru/curs/hurdygurdy/CodegenTest.noOwnTypes.approved.txt | 2 +- .../ru/curs/hurdygurdy/CodegenTest.oneOfSupport.approved.txt | 2 +- .../curs/hurdygurdy/CodegenTest.paramsOverriding.approved.txt | 2 +- .../hurdygurdy/KCodegenTest.dictionarySupport.approved.txt | 2 +- .../KCodegenTest.generateCommonParameters.approved.txt | 2 +- .../hurdygurdy/KCodegenTest.generateMultipart.approved.txt | 2 +- .../curs/hurdygurdy/KCodegenTest.generateSample1.approved.txt | 2 +- .../curs/hurdygurdy/KCodegenTest.generateSample2.approved.txt | 4 ++-- .../curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt | 2 +- .../ru/curs/hurdygurdy/KCodegenTest.noOwnTypes.approved.txt | 2 +- .../curs/hurdygurdy/KCodegenTest.nullableParent.approved.txt | 2 +- .../ru/curs/hurdygurdy/KCodegenTest.oneOfSupport.approved.txt | 2 +- .../hurdygurdy/KCodegenTest.paramsOverriding.approved.txt | 2 +- 23 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index f0b0c0e..65bd293 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ public class Car extends Vehicle { } ``` -This will procude the following in Kotlin: +This will produce the following in Kotlin: ```kotlin //Vehicle.kt diff --git a/pom.xml b/pom.xml index 3cb494c..9b93ca0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 ru.curs hurdy-gurdy - 1.31 + 2.00 maven-plugin OpenAPI codegen Maven Plugin @@ -120,7 +120,7 @@ org.apache.tomcat.embed tomcat-embed-core - 9.0.83 + 10.1.15 compile diff --git a/src/main/java/ru/curs/hurdygurdy/JavaAPIExtractor.java b/src/main/java/ru/curs/hurdygurdy/JavaAPIExtractor.java index 1b7044e..979a301 100644 --- a/src/main/java/ru/curs/hurdygurdy/JavaAPIExtractor.java +++ b/src/main/java/ru/curs/hurdygurdy/JavaAPIExtractor.java @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestPart; import javax.lang.model.element.Modifier; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.util.Map; import java.util.Optional; import java.util.stream.Stream; diff --git a/src/main/java/ru/curs/hurdygurdy/KotlinAPIExtractor.kt b/src/main/java/ru/curs/hurdygurdy/KotlinAPIExtractor.kt index bace1f1..b9b5db8 100644 --- a/src/main/java/ru/curs/hurdygurdy/KotlinAPIExtractor.kt +++ b/src/main/java/ru/curs/hurdygurdy/KotlinAPIExtractor.kt @@ -15,7 +15,7 @@ import io.swagger.v3.oas.models.parameters.Parameter import io.swagger.v3.oas.models.parameters.RequestBody import org.springframework.web.bind.annotation.* import java.util.* -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.reflect.KClass import kotlin.streams.asSequence diff --git a/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt b/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt index 4651e74..3ee32d3 100644 --- a/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt +++ b/src/main/java/ru/curs/hurdygurdy/KotlinTypeDefiner.kt @@ -317,7 +317,7 @@ class KotlinTypeDefiner internal constructor( val param = ParameterSpec.builder("additionalProperties", mapType) .defaultValue("HashMap()") - .addAnnotation(JsonAnySetter::class.java) + .addAnnotation(JsonAnySetter::class) .addAnnotation( AnnotationSpec.builder(JsonAnyGetter::class) .useSiteTarget(AnnotationSpec.UseSiteTarget.GET) @@ -339,7 +339,7 @@ class KotlinTypeDefiner internal constructor( private fun oneOfToInterface(schema: Schema<*>, openAPI: OpenAPI, classBuilder: TypeSpec.Builder) { if (schema.oneOf != null) { val builder = AnnotationSpec.builder(JsonSubTypes::class) - val subtypes = schema.oneOf.asSequence() + schema.oneOf.asSequence() .map { it.`$ref` } .filterNotNull() .map { referencedTypeName(it, openAPI) } diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.dictionarySupport.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.dictionarySupport.approved.txt index 515a6b9..8d54b8b 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.dictionarySupport.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.dictionarySupport.approved.txt @@ -10,8 +10,8 @@ /com/example/controller/Controller.java package com.example.controller; +import jakarta.servlet.http.HttpServletResponse; import java.lang.String; -import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.GetMapping; interface Controller { diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateCommonParameters.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateCommonParameters.approved.txt index e3b5f77..7baa390 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateCommonParameters.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateCommonParameters.approved.txt @@ -11,7 +11,7 @@ package com.example.controller; import com.example.dto.ToveDTO; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PutMapping; diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateMultipart.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateMultipart.approved.txt index 5eebe13..858e599 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateMultipart.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateMultipart.approved.txt @@ -11,7 +11,7 @@ package com.example.controller; import com.example.dto.RunWorkflowRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample1.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample1.approved.txt index cf58a1c..62190cf 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample1.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample1.approved.txt @@ -13,10 +13,10 @@ package com.example.controller; import com.example.dto.DatabaseConnectionRequest; import com.example.dto.MenuDTO; import com.example.dto.NullableType; +import jakarta.servlet.http.HttpServletResponse; import java.lang.Boolean; import java.lang.Integer; import java.lang.String; -import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample2.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample2.approved.txt index ade62b2..9ea7170 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample2.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.generateSample2.approved.txt @@ -11,9 +11,9 @@ package com.example.controller; import com.example.dto.PlayerActivitiesDTO; +import jakarta.servlet.http.HttpServletResponse; import java.lang.Integer; import java.lang.String; -import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -45,7 +45,7 @@ interface Controller { package com.example.controller; import com.example.dto.PlayersDTO; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.noOwnTypes.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.noOwnTypes.approved.txt index a24bfb7..6fcbbdb 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.noOwnTypes.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.noOwnTypes.approved.txt @@ -11,7 +11,7 @@ package com.example.controller; import com.example.collector.api.dto.LicenseResponse; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.GetMapping; interface LicenseController { diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.oneOfSupport.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.oneOfSupport.approved.txt index b010e11..0eb4e8a 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.oneOfSupport.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.oneOfSupport.approved.txt @@ -10,8 +10,8 @@ /com/example/controller/Controller.java package com.example.controller; +import jakarta.servlet.http.HttpServletResponse; import java.lang.String; -import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.GetMapping; interface Controller { diff --git a/src/test/java/ru/curs/hurdygurdy/CodegenTest.paramsOverriding.approved.txt b/src/test/java/ru/curs/hurdygurdy/CodegenTest.paramsOverriding.approved.txt index 0cef71a..c8d145d 100644 --- a/src/test/java/ru/curs/hurdygurdy/CodegenTest.paramsOverriding.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/CodegenTest.paramsOverriding.approved.txt @@ -11,8 +11,8 @@ package com.example.controller; import com.example.dto.BuildBundleElement; +import jakarta.servlet.http.HttpServletResponse; import java.lang.String; -import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.dictionarySupport.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.dictionarySupport.approved.txt index c70fde9..6a31303 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.dictionarySupport.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.dictionarySupport.approved.txt @@ -10,7 +10,7 @@ /com/example/controller/Controller.kt package com.example.controller -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.String import org.springframework.web.bind.`annotation`.GetMapping diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateCommonParameters.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateCommonParameters.approved.txt index da5d215..33f4a26 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateCommonParameters.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateCommonParameters.approved.txt @@ -11,7 +11,7 @@ package com.example.controller import com.example.dto.ToveDTO -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.Int import org.springframework.web.bind.`annotation`.GetMapping import org.springframework.web.bind.`annotation`.PathVariable diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateMultipart.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateMultipart.approved.txt index 5bc9852..f9c177c 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateMultipart.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateMultipart.approved.txt @@ -11,7 +11,7 @@ package com.example.controller import com.example.dto.RunWorkflowRequest -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import org.springframework.web.bind.`annotation`.PostMapping import org.springframework.web.bind.`annotation`.RequestPart import org.springframework.web.multipart.MultipartFile diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample1.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample1.approved.txt index 4438cf1..5422bc4 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample1.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample1.approved.txt @@ -13,7 +13,7 @@ package com.example.controller import com.example.dto.DatabaseConnectionRequest import com.example.dto.MenuDTO import com.example.dto.NullableType -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.Boolean import kotlin.Int import kotlin.String diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample2.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample2.approved.txt index 975b3f3..939febb 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample2.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample2.approved.txt @@ -11,7 +11,7 @@ package com.example.controller import com.example.dto.PlayerActivitiesDTO -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.Int import kotlin.String import org.springframework.web.bind.`annotation`.GetMapping @@ -49,7 +49,7 @@ public interface Controller { package com.example.controller import com.example.dto.PlayersDTO -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import org.springframework.web.bind.`annotation`.PostMapping import org.springframework.web.bind.`annotation`.RequestBody diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt index 95ac87d..2e6142e 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.generateSample3.approved.txt @@ -12,7 +12,7 @@ package com.example.controller import com.example.dto.CreateUpdateUserRequest import com.example.dto.UserResponse -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.Long import kotlin.collections.List import org.springframework.web.bind.`annotation`.DeleteMapping diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.noOwnTypes.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.noOwnTypes.approved.txt index 0cf0e35..663f5f8 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.noOwnTypes.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.noOwnTypes.approved.txt @@ -11,7 +11,7 @@ package com.example.controller import com.example.collector.api.dto.LicenseResponse -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import org.springframework.web.bind.`annotation`.GetMapping public interface LicenseController { diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.nullableParent.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.nullableParent.approved.txt index 800dd13..e9c6c36 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.nullableParent.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.nullableParent.approved.txt @@ -10,7 +10,7 @@ /com/example/controller/Controller.kt package com.example.controller -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.String import org.springframework.web.bind.`annotation`.GetMapping diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.oneOfSupport.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.oneOfSupport.approved.txt index aea6625..5d59b73 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.oneOfSupport.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.oneOfSupport.approved.txt @@ -10,7 +10,7 @@ /com/example/controller/Controller.kt package com.example.controller -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.String import org.springframework.web.bind.`annotation`.GetMapping diff --git a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.paramsOverriding.approved.txt b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.paramsOverriding.approved.txt index 5d5b42c..b4ff503 100644 --- a/src/test/java/ru/curs/hurdygurdy/KCodegenTest.paramsOverriding.approved.txt +++ b/src/test/java/ru/curs/hurdygurdy/KCodegenTest.paramsOverriding.approved.txt @@ -11,7 +11,7 @@ package com.example.controller import com.example.dto.BuildBundleElement -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.HttpServletResponse import kotlin.String import org.springframework.web.bind.`annotation`.GetMapping import org.springframework.web.bind.`annotation`.PathVariable