forked from loafle/openapi-generator-original
[BUGFIX][kotlin-spring] Fix generatedAnnotation to use the javaxPackage variable instead of jakarta to fix spring boot 2 codegen (#15944)
* Update generatedAnnotation.mustache Without this, it generates a jakarta annotation in the controllers of a spring boot 2 project. * Updated examples
This commit is contained in:
parent
94d76ff5d4
commit
f34e42b249
@ -1 +1 @@
|
|||||||
@jakarta.annotation.Generated(value = ["{{generatorClass}}"]{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
|
@{{javaxPackage}}.annotation.Generated(value = ["{{generatorClass}}"]{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
|
||||||
|
@ -10,7 +10,8 @@ import io.swagger.v3.oas.models.info.License
|
|||||||
import io.swagger.v3.oas.models.Components
|
import io.swagger.v3.oas.models.Components
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme
|
import io.swagger.v3.oas.models.security.SecurityScheme
|
||||||
|
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
class SpringDocConfiguration {
|
class SpringDocConfiguration {
|
||||||
|
|
||||||
|
@ -4,7 +4,8 @@ import org.springframework.stereotype.Controller
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
class PetApiController(
|
class PetApiController(
|
||||||
|
@ -14,7 +14,8 @@ import java.util.Optional
|
|||||||
* A delegate to be called by the {@link PetApiController}}.
|
* A delegate to be called by the {@link PetApiController}}.
|
||||||
* Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
|
* Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
|
||||||
*/
|
*/
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
interface PetApiDelegate {
|
interface PetApiDelegate {
|
||||||
|
|
||||||
fun getRequest(): Optional<NativeWebRequest> = Optional.empty()
|
fun getRequest(): Optional<NativeWebRequest> = Optional.empty()
|
||||||
|
@ -4,7 +4,8 @@ import org.springframework.stereotype.Controller
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
class StoreApiController(
|
class StoreApiController(
|
||||||
|
@ -13,7 +13,8 @@ import java.util.Optional
|
|||||||
* A delegate to be called by the {@link StoreApiController}}.
|
* A delegate to be called by the {@link StoreApiController}}.
|
||||||
* Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
|
* Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
|
||||||
*/
|
*/
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
interface StoreApiDelegate {
|
interface StoreApiDelegate {
|
||||||
|
|
||||||
fun getRequest(): Optional<NativeWebRequest> = Optional.empty()
|
fun getRequest(): Optional<NativeWebRequest> = Optional.empty()
|
||||||
|
@ -4,7 +4,8 @@ import org.springframework.stereotype.Controller
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
class UserApiController(
|
class UserApiController(
|
||||||
|
@ -13,7 +13,8 @@ import java.util.Optional
|
|||||||
* A delegate to be called by the {@link UserApiController}}.
|
* A delegate to be called by the {@link UserApiController}}.
|
||||||
* Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
|
* Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
|
||||||
*/
|
*/
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
interface UserApiDelegate {
|
interface UserApiDelegate {
|
||||||
|
|
||||||
fun getRequest(): Optional<NativeWebRequest> = Optional.empty()
|
fun getRequest(): Optional<NativeWebRequest> = Optional.empty()
|
||||||
|
@ -10,7 +10,8 @@ import io.swagger.v3.oas.models.info.License
|
|||||||
import io.swagger.v3.oas.models.Components
|
import io.swagger.v3.oas.models.Components
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme
|
import io.swagger.v3.oas.models.security.SecurityScheme
|
||||||
|
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
class SpringDocConfiguration {
|
class SpringDocConfiguration {
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2
|
|||||||
import javax.servlet.ServletContext
|
import javax.servlet.ServletContext
|
||||||
|
|
||||||
|
|
||||||
@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
@javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"])
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
class SpringFoxConfiguration {
|
class SpringFoxConfiguration {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user