Skip to content

Commit e3581e8

Browse files
committed
set useSpringBoot3 to true by default
1 parent fd0d43f commit e3581e8

1,505 files changed

Lines changed: 4707 additions & 4715 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/generators/java-camel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
116116
|useOptional|Use Optional container for optional parameters| |false|
117117
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true|
118118
|useSealed|Whether to generate sealed model interfaces and classes| |false|
119-
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
119+
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |true|
120120
|useSpringBoot4|Generate code and provide dependencies for use with Spring Boot 4.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
121121
|useSpringBuiltInValidation|Disable `@Validated` at the class level when using built-in validation.| |false|
122122
|useSpringController|Annotate the generated API as a Spring Controller| |false|

docs/generators/spring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
109109
|useOptional|Use Optional container for optional parameters| |false|
110110
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true|
111111
|useSealed|Whether to generate sealed model interfaces and classes| |false|
112-
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
112+
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |true|
113113
|useSpringBoot4|Generate code and provide dependencies for use with Spring Boot 4.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
114114
|useSpringBuiltInValidation|Disable `@Validated` at the class level when using built-in validation.| |false|
115115
|useSpringController|Annotate the generated API as a Spring Controller| |false|

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public enum RequestMappingMode {
163163
@Setter protected boolean generateGenericResponseEntity = false;
164164
@Setter protected boolean useEnumCaseInsensitive = false;
165165
@Getter @Setter
166-
protected boolean useSpringBoot3 = false;
166+
protected boolean useSpringBoot3 = true;
167167
@Getter @Setter
168168
protected boolean useSpringBoot4 = false;
169169
@Getter @Setter
@@ -520,6 +520,10 @@ public void processOpts() {
520520
convertPropertyToBooleanAndWriteBack(USE_JACKSON_3, this::setUseJackson3);
521521
convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT3, this::setUseSpringBoot3);
522522
convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT4, this::setUseSpringBoot4);
523+
524+
if (isUseSpringBoot4()) {
525+
setUseSpringBoot3(false);
526+
}
523527
if(isUseSpringBoot3() && isUseSpringBoot4()){
524528
throw new IllegalArgumentException("Choose between Spring Boot 3 and Spring Boot 4");
525529
}

samples/client/petstore/spring-cloud-auth/pom.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
<name>petstore-spring-cloud-auth</name>
77
<version>1.0.0</version>
88
<properties>
9-
<java.version>1.8</java.version>
10-
<maven.compiler.source>${java.version}</maven.compiler.source>
11-
<maven.compiler.target>${java.version}</maven.compiler.target>
9+
<java.version>17</java.version>
10+
<maven.compiler.release>${java.version}</maven.compiler.release>
1211
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1312
</properties>
1413
<parent>
1514
<groupId>org.springframework.boot</groupId>
1615
<artifactId>spring-boot-starter-parent</artifactId>
17-
<version>2.7.15</version>
16+
<version>3.3.13</version>
1817
<relativePath/> <!-- lookup parent from repository -->
1918
</parent>
19+
2020
<build>
2121
<sourceDirectory>src/main/java</sourceDirectory>
2222

@@ -27,7 +27,7 @@
2727
<dependency>
2828
<groupId>org.springframework.cloud</groupId>
2929
<artifactId>spring-cloud-starter-parent</artifactId>
30-
<version>2021.0.5</version>
30+
<version>2023.0.0</version>
3131
<type>pom</type>
3232
<scope>import</scope>
3333
</dependency>
@@ -48,7 +48,6 @@
4848
<dependency>
4949
<groupId>org.springframework.security</groupId>
5050
<artifactId>spring-security-oauth2-client</artifactId>
51-
<version>5.7.8</version>
5251
</dependency>
5352
<dependency>
5453
<groupId>com.fasterxml.jackson.datatype</groupId>
@@ -57,7 +56,7 @@
5756
<dependency>
5857
<groupId>org.openapitools</groupId>
5958
<artifactId>jackson-databind-nullable</artifactId>
60-
<version>0.2.8</version>
59+
<version>0.2.9</version>
6160
</dependency>
6261
<dependency>
6362
<groupId>org.springframework.boot</groupId>

samples/client/petstore/spring-cloud-auth/src/main/java/org/openapitools/api/SomeApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
import org.springframework.web.bind.annotation.*;
1111
import org.springframework.web.multipart.MultipartFile;
1212

13-
import javax.validation.Valid;
14-
import javax.validation.constraints.*;
13+
import jakarta.validation.Valid;
14+
import jakarta.validation.constraints.*;
1515
import java.util.List;
1616
import java.util.Map;
1717
import java.util.Optional;
18-
import javax.annotation.Generated;
18+
import jakarta.annotation.Generated;
1919

2020
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
2121
@Validated

samples/client/petstore/spring-cloud-date-time/pom.xml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
<name>spring-cloud-date-time</name>
77
<version>1.0</version>
88
<properties>
9-
<java.version>1.8</java.version>
10-
<maven.compiler.source>${java.version}</maven.compiler.source>
11-
<maven.compiler.target>${java.version}</maven.compiler.target>
9+
<java.version>17</java.version>
10+
<maven.compiler.release>${java.version}</maven.compiler.release>
1211
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<springdoc.version>1.6.14</springdoc.version>
12+
<springdoc.version>2.2.0</springdoc.version>
1413
</properties>
1514
<parent>
1615
<groupId>org.springframework.boot</groupId>
1716
<artifactId>spring-boot-starter-parent</artifactId>
18-
<version>2.7.15</version>
17+
<version>3.3.13</version>
1918
<relativePath/> <!-- lookup parent from repository -->
2019
</parent>
20+
2121
<build>
2222
<sourceDirectory>src/main/java</sourceDirectory>
2323
<plugins>
@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>org.springframework.cloud</groupId>
4343
<artifactId>spring-cloud-starter-parent</artifactId>
44-
<version>2021.0.5</version>
44+
<version>2023.0.0</version>
4545
<type>pom</type>
4646
<scope>import</scope>
4747
</dependency>
@@ -50,11 +50,11 @@
5050

5151
<dependencies>
5252
<!--SpringDoc dependencies -->
53-
<dependency>
53+
<dependency>
5454
<groupId>org.springdoc</groupId>
55-
<artifactId>springdoc-openapi-ui</artifactId>
55+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
5656
<version>${springdoc.version}</version>
57-
</dependency>
57+
</dependency>
5858
<!-- @Nullable annotation -->
5959
<dependency>
6060
<groupId>com.google.code.findbugs</groupId>
@@ -68,7 +68,6 @@
6868
<dependency>
6969
<groupId>org.springframework.security</groupId>
7070
<artifactId>spring-security-oauth2-client</artifactId>
71-
<version>5.7.8</version>
7271
</dependency>
7372
<dependency>
7473
<groupId>com.fasterxml.jackson.datatype</groupId>
@@ -77,7 +76,7 @@
7776
<dependency>
7877
<groupId>org.openapitools</groupId>
7978
<artifactId>jackson-databind-nullable</artifactId>
80-
<version>0.2.8</version>
79+
<version>0.2.9</version>
8180
</dependency>
8281
<dependency>
8382
<groupId>org.springframework.boot</groupId>

samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
import org.springframework.web.bind.annotation.*;
2727
import org.springframework.web.multipart.MultipartFile;
2828

29-
import javax.validation.Valid;
30-
import javax.validation.constraints.*;
29+
import jakarta.validation.Valid;
30+
import jakarta.validation.constraints.*;
3131
import java.util.List;
3232
import java.util.Map;
3333
import java.util.Optional;
34-
import javax.annotation.Generated;
34+
import jakarta.annotation.Generated;
3535

3636
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
3737
@Validated

samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
import org.springframework.lang.Nullable;
1212
import org.openapitools.jackson.nullable.JsonNullable;
1313
import java.time.OffsetDateTime;
14-
import javax.validation.Valid;
15-
import javax.validation.constraints.*;
14+
import jakarta.validation.Valid;
15+
import jakarta.validation.constraints.*;
1616
import io.swagger.v3.oas.annotations.media.Schema;
1717

1818

1919
import java.util.*;
20-
import javax.annotation.Generated;
20+
import jakarta.annotation.Generated;
2121

2222
/**
2323
* Pet

samples/client/petstore/spring-cloud-deprecated/pom.xml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
<name>spring-cloud-deprecated</name>
77
<version>1.0.0</version>
88
<properties>
9-
<java.version>1.8</java.version>
10-
<maven.compiler.source>${java.version}</maven.compiler.source>
11-
<maven.compiler.target>${java.version}</maven.compiler.target>
9+
<java.version>17</java.version>
10+
<maven.compiler.release>${java.version}</maven.compiler.release>
1211
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<springdoc.version>1.6.14</springdoc.version>
12+
<springdoc.version>2.2.0</springdoc.version>
1413
</properties>
1514
<parent>
1615
<groupId>org.springframework.boot</groupId>
1716
<artifactId>spring-boot-starter-parent</artifactId>
18-
<version>2.7.15</version>
17+
<version>3.3.13</version>
1918
<relativePath/> <!-- lookup parent from repository -->
2019
</parent>
20+
2121
<build>
2222
<sourceDirectory>src/main/java</sourceDirectory>
2323
<plugins>
@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>org.springframework.cloud</groupId>
4343
<artifactId>spring-cloud-starter-parent</artifactId>
44-
<version>2021.0.5</version>
44+
<version>2023.0.0</version>
4545
<type>pom</type>
4646
<scope>import</scope>
4747
</dependency>
@@ -50,11 +50,11 @@
5050

5151
<dependencies>
5252
<!--SpringDoc dependencies -->
53-
<dependency>
53+
<dependency>
5454
<groupId>org.springdoc</groupId>
55-
<artifactId>springdoc-openapi-ui</artifactId>
55+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
5656
<version>${springdoc.version}</version>
57-
</dependency>
57+
</dependency>
5858
<!-- @Nullable annotation -->
5959
<dependency>
6060
<groupId>com.google.code.findbugs</groupId>
@@ -68,7 +68,6 @@
6868
<dependency>
6969
<groupId>org.springframework.security</groupId>
7070
<artifactId>spring-security-oauth2-client</artifactId>
71-
<version>5.7.8</version>
7271
</dependency>
7372
<dependency>
7473
<groupId>com.fasterxml.jackson.datatype</groupId>
@@ -77,7 +76,7 @@
7776
<dependency>
7877
<groupId>org.openapitools</groupId>
7978
<artifactId>jackson-databind-nullable</artifactId>
80-
<version>0.2.8</version>
79+
<version>0.2.9</version>
8180
</dependency>
8281
<dependency>
8382
<groupId>org.springframework.boot</groupId>

samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
import org.springframework.web.bind.annotation.*;
2626
import org.springframework.web.multipart.MultipartFile;
2727

28-
import javax.validation.Valid;
29-
import javax.validation.constraints.*;
28+
import jakarta.validation.Valid;
29+
import jakarta.validation.constraints.*;
3030
import java.util.List;
3131
import java.util.Map;
3232
import java.util.Optional;
33-
import javax.annotation.Generated;
33+
import jakarta.annotation.Generated;
3434

3535
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
3636
@Validated

0 commit comments

Comments
 (0)