Skip to content

Commit 9510e37

Browse files
authored
Add files via upload
1 parent e20f64c commit 9510e37

Some content is hidden

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

44 files changed

+2275
-379
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Spring Boot Server
66
## Overview
77
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project.
88
By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub.
9-
This is an example of building a swagger-enabled server in Java using the SpringBoot framework.
9+
This is an example of building a swagger-enabled server in Java using the SpringBoot framework.
1010

11-
The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox)
11+
The underlying library integrating swagger to SpringBoot is [springdoc-openapi](https://github.com/springdoc/springdoc-openapi)
1212

1313
Start your server as an simple java application
1414

pom.xml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<java.version>1.7</java.version>
1010
<maven.compiler.source>${java.version}</maven.compiler.source>
1111
<maven.compiler.target>${java.version}</maven.compiler.target>
12-
<springfox-version>2.9.2</springfox-version>
12+
<springfox-version>3.0.0</springfox-version>
1313
</properties>
1414
<parent>
1515
<groupId>org.springframework.boot</groupId>
1616
<artifactId>spring-boot-starter-parent</artifactId>
17-
<version>1.5.22.RELEASE</version>
17+
<version>2.1.16.RELEASE</version>
1818
</parent>
1919
<build>
2020
<sourceDirectory>src/main/java</sourceDirectory>
@@ -41,10 +41,11 @@
4141
<groupId>org.springframework.boot</groupId>
4242
<artifactId>spring-boot-starter-tomcat</artifactId>
4343
</dependency>
44+
4445
<!--SpringFox dependencies -->
4546
<dependency>
4647
<groupId>io.springfox</groupId>
47-
<artifactId>springfox-swagger2</artifactId>
48+
<artifactId>springfox-oas</artifactId>
4849
<version>${springfox-version}</version>
4950
</dependency>
5051
<dependency>
@@ -53,17 +54,25 @@
5354
<version>${springfox-version}</version>
5455
</dependency>
5556

57+
5658
<dependency>
5759
<groupId>com.github.joschi.jackson</groupId>
5860
<artifactId>jackson-datatype-threetenbp</artifactId>
5961
<version>2.6.4</version>
6062
</dependency>
61-
<!-- Bean Validation API support -->
63+
64+
<!-- Bean Validation API support -->
6265
<dependency>
6366
<groupId>javax.validation</groupId>
6467
<artifactId>validation-api</artifactId>
6568
</dependency>
6669

70+
<dependency>
71+
<groupId>org.springframework.plugin</groupId>
72+
<artifactId>spring-plugin-core</artifactId>
73+
<version>2.0.0.RELEASE</version>
74+
</dependency>
75+
6776
<dependency>
6877
<groupId>org.springframework.boot</groupId>
6978
<artifactId>spring-boot-starter-test</artifactId>

src/main/java/io/swagger/Swagger2SpringBoot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import org.springframework.boot.autoconfigure.SpringBootApplication;
77
import org.springframework.context.annotation.ComponentScan;
88

9-
import springfox.documentation.swagger2.annotations.EnableSwagger2;
9+
import springfox.documentation.oas.annotations.EnableOpenApi;
1010

1111
@SpringBootApplication
12-
@EnableSwagger2
12+
@EnableOpenApi
1313
@ComponentScan(basePackages = { "io.swagger", "io.swagger.api" , "io.swagger.configuration"})
1414
public class Swagger2SpringBoot implements CommandLineRunner {
1515

src/main/java/io/swagger/api/ApiException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.swagger.api;
22

3-
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-01-30T02:08:15.864Z[GMT]")
4-
public class ApiException extends Exception{
3+
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2021-03-09T22:27:46.582Z[GMT]")
4+
public class ApiException extends Exception {
55
private int code;
66
public ApiException (int code, String msg) {
77
super(msg);

src/main/java/io/swagger/api/ApiOriginFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import javax.servlet.*;
66
import javax.servlet.http.HttpServletResponse;
77

8-
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-01-30T02:08:15.864Z[GMT]")
8+
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2021-03-09T22:27:46.582Z[GMT]")
99
public class ApiOriginFilter implements javax.servlet.Filter {
1010
@Override
1111
public void doFilter(ServletRequest request, ServletResponse response,

src/main/java/io/swagger/api/ApiResponseMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import javax.xml.bind.annotation.XmlTransient;
44

5-
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-01-30T02:08:15.864Z[GMT]")
5+
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2021-03-09T22:27:46.582Z[GMT]")
66
@javax.xml.bind.annotation.XmlRootElement
77
public class ApiResponseMessage {
88
public static final int ERROR = 1;

0 commit comments

Comments
 (0)