Skip to content

Commit fcfda63

Browse files
committed
changed dependecies from io.swagger to io.swagger.core.v3 changed imports for annotations for api
1 parent ffb1961 commit fcfda63

File tree

9 files changed

+21
-22
lines changed

9 files changed

+21
-22
lines changed

modules/openapi-generator-maven-plugin/examples/java-client.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
</dependencies>
180180

181181
<properties>
182-
<swagger-annotations-version>1.5.8</swagger-annotations-version>
182+
<swagger-annotations-version>2.1.1</swagger-annotations-version>
183183
<jersey-version>2.27</jersey-version>
184184
<jackson-version>2.8.9</jackson-version>
185185
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>

modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<!-- dependencies are needed for the client being generated -->
7777

7878
<dependency>
79-
<groupId>io.swagger</groupId>
79+
<groupId>io.swagger.core.v3</groupId>
8080
<artifactId>swagger-annotations</artifactId>
8181
<version>${swagger-annotations-version}</version>
8282
</dependency>

modules/openapi-generator-maven-plugin/examples/spring.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
</dependencies>
119119

120120
<properties>
121-
<swagger-annotations-version>1.5.8</swagger-annotations-version>
121+
<swagger-annotations-version>2.1.1</swagger-annotations-version>
122122

123123
<spring-boot-starter-web.version>2.2.1.RELEASE</spring-boot-starter-web.version>
124124
<springfox-version>2.8.0</springfox-version>

modules/openapi-generator/src/main/resources/JavaSpring/api.mustache

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ package {{package}};
77

88
{{#imports}}import {{import}};
99
{{/imports}}
10-
import io.swagger.annotations.*;
10+
import io.swagger.v3.oas.annotations.*;
11+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
12+
import io.swagger.v3.oas.annotations.responses.ApiResponses;
13+
import io.swagger.v3.oas.annotations.tags.Tag;
1114
{{#jdk8-no-delegate}}
1215
{{#virtualService}}
1316
import io.virtualan.annotation.ApiVirtual;
@@ -60,7 +63,7 @@ import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture
6063
{{#useBeanValidation}}
6164
@Validated
6265
{{/useBeanValidation}}
63-
@Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API")
66+
@Tag(name = "{{{baseName}}}", description = "the {{{baseName}}} API")
6467
{{#operations}}
6568
{{#virtualService}}
6669
@VirtualService
@@ -106,23 +109,18 @@ public interface {{classname}} {
106109
{{#virtualService}}
107110
@ApiVirtual
108111
{{/virtualService}}
109-
@ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
110-
{{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = {
111-
{{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}},
112-
{{/hasMore}}{{/scopes}}
113-
}{{/isOAuth}}){{#hasMore}},
114-
{{/hasMore}}{{/authMethods}}
115-
}{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} })
112+
@Operation(summary = "{{{summary}}}", description = "{{{notes}}}",
113+
tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} },
116114
@ApiResponses(value = { {{#responses}}
117-
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} })
118-
{{#implicitHeaders}}
115+
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} })
116+
{{#implicitHeaders}}}
119117
@ApiImplicitParams({
120118
{{#headerParams}}
121119
{{>implicitHeader}}
122120
{{/headerParams}}
123121
})
124122
{{/implicitHeaders}}
125-
@RequestMapping(value = "{{{path}}}",{{#singleContentTypes}}{{#hasProduces}}
123+
@Parameter(value = "{{{path}}}",{{#singleContentTypes}}{{#hasProduces}}
126124
produces = "{{{vendorExtensions.x-accepts}}}", {{/hasProduces}}{{#hasConsumes}}
127125
consumes = "{{{vendorExtensions.x-contentType}}}",{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}
128126
produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}}

modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package {{package}};
33
{{^jdk8}}
44
{{#imports}}import {{import}};
55
{{/imports}}
6-
import io.swagger.annotations.*;
6+
import io.swagger.v3.oas.annotations.*;
77
import org.springframework.http.HttpStatus;
88
import org.springframework.http.MediaType;
99
import org.springframework.http.ResponseEntity;

modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package {{package}};
22

33
{{#imports}}import {{import}};
44
{{/imports}}
5-
import io.swagger.annotations.*;
5+
import io.swagger.v3.oas.annotations.*;
6+
import io.swagger.v3.oas.annotations.tags.Tag;
67
{{#jdk8}}
78
import org.springframework.http.HttpStatus;
89
import org.springframework.http.MediaType;

modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@
107107
<version>3.14.2</version>
108108
</dependency>
109109
<dependency>
110-
<groupId>io.swagger</groupId>
110+
<groupId>io.swagger.core.v3</groupId>
111111
<artifactId>swagger-annotations</artifactId>
112-
<version>1.5.14</version>
112+
<version>2.1.1</version>
113113
</dependency>
114114
<!-- @Nullable annotation -->
115115
<dependency>

modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
{{/parentOverridden}}
4646
<dependencies>
4747
<dependency>
48-
<groupId>io.swagger</groupId>
48+
<groupId>io.swagger.core.v3</groupId>
4949
<artifactId>swagger-annotations</artifactId>
5050
{{^parentOverridden}}
5151
<version>${swagger-core-version}</version>

modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@
173173
<version>3.14.2</version>
174174
</dependency>
175175
<dependency>
176-
<groupId>io.swagger</groupId>
176+
<groupId>io.swagger.core.v3</groupId>
177177
<artifactId>swagger-annotations</artifactId>
178-
<version>1.5.14</version>
178+
<version>2.1.1</version>
179179
</dependency>
180180
<!-- @Nullable annotation -->
181181
<dependency>

0 commit comments

Comments
 (0)