Skip to content

Commit

Permalink
[eclipse-hawkbit#1383] Spring Boot 3 migration Step 2: fix swagger
Browse files Browse the repository at this point in the history
Signed-off-by: Marinov Avgustin <[email protected]
  • Loading branch information
avgustinmm committed Jan 26, 2024
1 parent fc3cbe5 commit e64c3f9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 47 deletions.
11 changes: 1 addition & 10 deletions hawkbit-rest/hawkbit-ddi-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,9 @@
<artifactId>hawkbit-rest-core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Swagger Support -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-hateoas</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>

<!-- TEST -->
Expand Down
11 changes: 1 addition & 10 deletions hawkbit-rest/hawkbit-mgmt-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,9 @@
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
<!-- Swagger Support -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-hateoas</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>

<dependency>
Expand Down
10 changes: 1 addition & 9 deletions hawkbit-rest/hawkbit-rest-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,7 @@
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-hateoas</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
*/
package org.eclipse.hawkbit.rest;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springdoc.core.GroupedOpenApi;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -51,7 +50,7 @@ public GroupedOpenApi mgmtApi() {
.builder()
.group("Management API")
.pathsToMatch("/rest/v1/**")
.addOpenApiCustomiser(openApi -> {
.addOpenApiCustomizer(openApi -> {
openApi
.addSecurityItem(new SecurityRequirement()
.addList(BASIC_AUTH_SEC_SCHEME_NAME)
Expand Down Expand Up @@ -85,7 +84,7 @@ public GroupedOpenApi ddiApi() {
.builder()
.group("Direct Device Integration API")
.pathsToMatch("/{tenant}/controller/**")
.addOpenApiCustomiser(openApi -> {
.addOpenApiCustomizer(openApi -> {
openApi
.addSecurityItem(new SecurityRequirement().addList(DDI_TOKEN_SEC_SCHEME_NAME))
.components(
Expand Down
16 changes: 2 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,9 @@

<spring.boot.version>3.2.1</spring.boot.version>
<spring.cloud.version>2023.0.0</spring.cloud.version>
<springdoc-openapi.version>2.3.0</springdoc-openapi.version>
<spring.plugin.core.version>3.0.0</spring.plugin.core.version>

<!-- Swagger Support -->
<springdoc-openapi.version>1.7.0</springdoc-openapi.version>

<!-- Spring boot version overrides (should be reviewed with every boot upgrade) - START -->
<!-- Newer versions needed than defined in Boot -->
Expand Down Expand Up @@ -732,20 +731,9 @@
<scope>compile</scope>
</dependency>

<!-- Swagger Support -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc-openapi.version}</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-hateoas</artifactId>
<version>${springdoc-openapi.version}</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc-openapi.version}</version>
</dependency>

Expand Down

0 comments on commit e64c3f9

Please sign in to comment.